std.file.DirEntry.isFile
- multiple declarations
Function DirEntry.isFile
Returns whether the file represented by this DirEntry
is a file.
bool isFile() @property @safe;
On Windows, if a file is not a directory, then it's a file. So,
either isFile
or isDir
will return true
.
On POSIX systems, if isFile
is true
, that indicates that
the file is a regular file (e.g. not a block not device). So, on
POSIX systems, it's possible for both isFile
and isDir
to
be false
for a particular file (in which case, it's a special
file). You can use attributes
or statBuf
to get more
information about a special file (see the stat man page for more
details).
Example
auto de1 = DirEntry("/etc/fonts/fonts.conf");
assert(de1 .isFile);
auto de2 = DirEntry("/usr/share/include");
assert(!de2 .isFile);
Function DirEntry.isFile
Returns whether the file represented by this DirEntry
is a file.
bool isFile() @property @safe;
On Windows, if a file is not a directory, then it's a file. So,
either isFile
or isDir
will return true
.
On POSIX systems, if isFile
is true
, that indicates that
the file is a regular file (e.g. not a block not device). So, on
POSIX systems, it's possible for both isFile
and isDir
to
be false
for a particular file (in which case, it's a special
file). You can use attributes
or statBuf
to get more
information about a special file (see the stat man page for more
details).
Example
auto de1 = DirEntry("/etc/fonts/fonts.conf");
assert(de1 .isFile);
auto de2 = DirEntry("/usr/share/include");
assert(!de2 .isFile);