Function std.file.attrIsFile
Returns whether the given file attributes
are for a file.
On Windows, if a file is not a directory, it's a file. So, either
or attrIsFile
will return attrIsDir
true
for the
attributes
of any given file.
On Posix systems, if
is attrIsFile
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
and attrIsFile
to be attrIsDir
false
for a particular file (in which case, it's a special file). If a file is a
special file, you can use the attributes
to check what type of special file
it is (see the man page for stat
for more information).
Prototype
bool attrIsFile( uint attributes ) pure nothrow @nogc @safe;
Parameters
Name | Description |
---|---|
attributes | The file attributes . |
Returns
true if the given file attributes
are for a file
Examples
assert(attrIsFile(getAttributes("/etc/fonts/fonts.conf"))); assert(attrIsFile(getLinkAttributes("/etc/fonts/fonts.conf")));
Authors
Walter Bright, Andrei Alexandrescu, Jonathan M Davis