Example: -------------------- assert(attrIsFile(getAttributes("/etc/fonts/fonts.conf"))); assert(attrIsFile(getLinkAttributes("/etc/fonts/fonts.conf"))); --------------------
attrIsFile
fn
bool attrIsFile(uint attributes) @safe pure nothrow @nogcReturns whether the given file _attributes are for a file.
On Windows, if a file is not a directory, it's a file. So, either attrIsFile or attrIsDir will return true for the _attributes of any given file.
On POSIX systems, if attrIsFile 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 attrIsFile and attrIsDir to be 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).
Parameters
attributes | The file _attributes. |
Returns
true if the given file _attributes are for a file