View source code
Display the source code in std/file.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
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.

Struct std.file.DirEntry

Info on a file, similar to what you'd get from stat on a POSIX system.

struct DirEntry ;
struct DirEntry ;

Constructors

NameDescription
this Constructs a DirEntry for the given file (or directory).

Properties

NameTypeDescription
attributes[get] uintReturns the attributes of the file represented by this DirEntry.
isDir[get] boolReturns whether the file represented by this DirEntry is a directory.
isFile[get] boolReturns whether the file represented by this DirEntry is a file.
isSymlink[get] boolReturns whether the file represented by this DirEntry is a symbolic link.
linkAttributes[get] uintOn POSIX systems, if the file represented by this DirEntry is a symbolic link, then linkAttributes are the attributes of the symbolic link itself. Otherwise, linkAttributes is identical to attributes.
name[get] stringReturns the path to the file represented by this DirEntry.
size[get] ulongReturns the size of the the file represented by this DirEntry in bytes.
statBuf[get] core.sys.posix.sys.stat.stat_tThis function is POSIX-Only.
timeCreated[get] SysTimeThis function is Windows-Only.
timeLastAccessed[get] SysTimeReturns the time that the file represented by this DirEntry was last accessed.
timeLastModified[get] SysTimeReturns the time that the file represented by this DirEntry was last modified.
timeStatusChanged[get] SysTimeThis function is POSIX-Only.

Constructors

NameDescription
this Constructs a DirEntry for the given file (or directory).

Properties

NameTypeDescription
attributes[get] uintReturns the attributes of the file represented by this DirEntry.
isDir[get] boolReturns whether the file represented by this DirEntry is a directory.
isFile[get] boolReturns whether the file represented by this DirEntry is a file.
isSymlink[get] boolReturns whether the file represented by this DirEntry is a symbolic link.
linkAttributes[get] uintOn POSIX systems, if the file represented by this DirEntry is a symbolic link, then linkAttributes are the attributes of the symbolic link itself. Otherwise, linkAttributes is identical to attributes.
name[get] stringReturns the path to the file represented by this DirEntry.
size[get] ulongReturns the size of the the file represented by this DirEntry in bytes.
statBuf[get] core.sys.posix.sys.stat.stat_tThis function is POSIX-Only.
timeCreated[get] SysTimeThis function is Windows-Only.
timeLastAccessed[get] SysTimeReturns the time that the file represented by this DirEntry was last accessed.
timeLastModified[get] SysTimeReturns the time that the file represented by this DirEntry was last modified.
timeStatusChanged[get] SysTimeThis function is POSIX-Only.

Authors

Walter Bright, Andrei Alexandrescu, Jonathan M Davis

License

Boost License 1.0.