Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
4c243478
Commit
4c243478
authored
Aug 24, 2018
by
Max Kellermann
Committed by
Max Kellermann
Aug 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
system/FileDescriptor: add method IsRegularFile()
parent
ca9daf5e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
FileDescriptor.cxx
src/system/FileDescriptor.cxx
+7
-0
FileDescriptor.hxx
src/system/FileDescriptor.hxx
+6
-0
No files found.
src/system/FileDescriptor.cxx
View file @
4c243478
...
...
@@ -60,6 +60,13 @@ FileDescriptor::IsValid() const noexcept
}
bool
FileDescriptor
::
IsRegularFile
()
const
noexcept
{
struct
stat
st
;
return
IsDefined
()
&&
fstat
(
fd
,
&
st
)
==
0
&&
S_ISREG
(
st
.
st_mode
);
}
bool
FileDescriptor
::
IsPipe
()
const
noexcept
{
struct
stat
st
;
...
...
src/system/FileDescriptor.hxx
View file @
4c243478
...
...
@@ -79,6 +79,12 @@ public:
bool
IsValid
()
const
noexcept
;
/**
* Ask the kernel whether this is a regular file.
*/
gcc_pure
bool
IsRegularFile
()
const
noexcept
;
/**
* Ask the kernel whether this is a pipe.
*/
gcc_pure
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment