View source code
Display the source code in dmd/root/filename.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 dmd.root.filename.FileName

Encapsulate path and file names.

struct FileName ;

Constructors

NameDescription
this (str)

Methods

NameDescription
absolute (name) Determine if path is absolute.
addExt (name, ext) Add the extension ext to name, regardless of the content of name
canonicalName (name) Return canonical version of name. This code is high risk.
combine (path, name) Combine a path and a file name
create (name)
defaultExt (name, ext) Free returned value with FileName::free()
ensurePathExists (path) Ensure that the provided path exists
equals (name1, name2) Compare two name according to the platform's rules (case sensitive or not)
equalsExt (name, ext)
equalsExt (ext) Return !=0 if extensions match.
exists (name) Check if the file the path points to exists
ext (str) Determine file name extension as slice of input.
findReservedChar (name) Determine if path contains reserved character.
forceExt (name, ext) Free returned value with FileName::free()
free (str) Free memory allocated by FileName routines
name (str) Return filename name excluding path (read-only).
path (str) Return path portion of str. returned string is newly allocated Path does not include trailing path separator.
refersToParentDir (name) Determine if path has a reference to parent directory.
removeExt (str) Return file name without extension.
replaceName (path, name) Replace filename portion of path.
searchPath (path, name, cwd) Search paths for file.
splitPath (sink, path) Split path (such as that returned by getenv("PATH")) into pieces, each piece is mem.xmalloc'd Handle double quotes and ~. Pass the pieces to sink()
toAbsolute (name, base) Return the given name as an absolute path

Authors

Walter Bright, https://www.digitalmars.com

License

Boost License 1.0