View source code
Display the source code in std/file.d from which this page was generated on
github.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
local clone.
Page wiki
View or edit the community-maintained wiki page associated with this page.
Function std.file.getAttributes
Returns the attributes of the given file.
Note that the file attributes on Windows and Posix systems are
completely different. On Windows, they're what is returned by
GetFileAttributes, whereas on Posix systems, they're the st_mode value which is part of the stat struct
gotten by
calling the stat
function.
On Posix systems, if the given file is a symbolic link, then attributes are the attributes of the file pointed to by the symbolic link.
Prototype
uint getAttributes( const(char[]) name ) @safe;
Parameters
Name | Description |
---|---|
name | The file to get the attributes of. |
Throws
on error.
FileException
Authors
Walter Bright, Andrei Alexandrescu, Jonathan M Davis