Create a FilePath from a copy of the provided string.
Filter used for screening paths via toList().
Support path ~= x; syntax
Convert this FilePath to absolute format, using the given prefix as necessary. If this FilePath is already absolute, return it intact.
Returns the time of the last access. Accurate to whatever the OS supports, and in a format dictated by the file system. For example NTFS keeps UTC time, while FAT timestamps are based on the local time.
Append a folder to this path. A leading separator is added as required.
Return the complete text of this filepath as a null terminated string for use with a C api. Use toString instead for any D api.
Concatenate text to this path; no separators are added.
Transfer the content of another file to this one. Returns a reference to this class on success, or throws an IOException upon failure.
Transfer the content of another file to this one. Returns a reference to this class on success, or throws an IOException upon failure.
Create an entire path consisting of this folder along with all parent folders. The path must not contain '.' or '..' segments. Related methods include PathUtil.normalize() and absolute().
Create a new file.
Create a new directory.
Returns the time of file creation. Accurate to whatever the OS supports, and in a format dictated by the file system. For example NTFS keeps UTC time, while FAT timestamps are based on the local time.
Duplicate this path.
Does this path currently exist?.
Ext is the tail of the filename, rightward of the rightmost '.' separator e.g. path "foo.bar" has ext "bar". Note that patterns of adjacent separators are treated specially; for example, ".." will wind up with no ext at all.
Return the name + suffix combination.
Replace the file and suffix portions of this path and reparse. The replacement will be prefixed with a suffix separator as required.
Return the file length (in bytes).
Return the file path.
Replace the folder portion of this path. The folder will be padded with a path-separator as required.
Returns true if this FilePath is *not* relative to the current working directory.
Returns true if this FilePath has a parent. Note that a parent is defined by the presence of a path-separator in the path. This means 'foo' within "\foo" is considered a child of the root.
Returns true if this FilePath is empty.
Is this a regular file?
Sidestep the normal lookup for paths that are known to be folders. Where folder is true, file system lookups will be skipped.
Is this file actually a folder/directory?
Is this file writable?
Create a new name for a file (also known as -hard-linking)
Returns the time of the last modification. Accurate to whatever the OS supports, and in a format dictated by the file system. For example NTFS keeps UTC time, while FAT timestamps are based on the local time.
Return the name of this file, or directory.
Replace the name portion of this path.
Convert to native O/S path separators where that is required, such as when dealing with the Windows command-line.
List the set of filenames within this folder.
Returns true if all fields are identical. Note that some combinations of operations may not produce an identical set of fields. For example:
Does this FilePath match the given text? Note that some combinations of operations may not produce an identical set of fields. For example:
Returns a path representing the parent of this one. This will typically return the current path component, though with a special case where the name component is empty. In such cases, the path is scanned for a prior segment:
Return the root + folder combination.
Replace the root and folder portions of this path and reparse. The replacement will be padded with a path separator as required.
Pop to the parent of the current filepath (in situ - mutates this FilePath). Note that this differs from parent() in that it does not include any special cases.
Prepend a folder to this path. A trailing separator is added if needed.
Remove the file/directory from the file system.
Change the name or location of a file/directory, and adopt the provided Path.
change the name or location of a file/directory, and adopt the provided Path.
Replace all 'from' instances with 'to'.
Return the root of this path. Roots are constructs such as "C:".
Replace the root portion of this path.
Reset the content of this path to that of another and reparse.
Reset the content of this path, and reparse. There's an optional boolean flag to convert the path into standard form, before parsing (converting '\' into '/').
Convert path separators to a standard format, using '/' as the path separator. This is compatible with URI and all of the contemporary O/S which Tango supports. Known exceptions include the Windows command-line processor, which considers '/' characters to be switches instead. Use the native() method to support that.
Suffix is like ext, but includes the separator e.g. path "foo.bar" has suffix ".bar".
Replace the suffix portion of this path. The suffix will be prefixed with a file-separator as required.
Return timestamp information.
List the set of filenames within this folder, using the provided filter to control the list:
Return the complete text of this filepath.
Construct a FilePath from the given FileInfo.
Join a set of path specs together. A path separator is potentially inserted between each of the segments.
Call-site shortcut to create a FilePath instance. This enables the same syntax as struct usage, so may expose a migration path.
Return an adjusted path such that non-empty instances always have a trailing separator.
Return an adjusted path such that non-empty instances always have a prefixed separator.
Return an adjusted path such that non-empty instances do not have a trailing separator.
Return the complete text of this filepath.
Return the complete text of this filepath.
Return the root of this path. Roots are constructs such as "C:".
Return the file path. Paths may start and end with a "/". The root path is "/" and an unspecified path is returned as an empty string. Directory paths may be split such that the directory name is placed into the 'name' member; directory paths are treated no differently than file paths.
Return the name of this file, or directory, excluding a suffix.
Ext is the tail of the filename, rightward of the rightmost '.' separator e.g. path "foo.bar" has ext "bar". Note that patterns of adjacent separators are treated specially; for example, ".." will wind up with no ext at all.
Suffix is like ext, but includes the separator e.g. path "foo.bar" has suffix ".bar".
Return the root + folder combination.
Return the name + suffix combination.
Returns true if this FilePath is *not* relative to the current working directory.
Returns true if this FilePath is empty.
Returns true if this FilePath has a parent.
Does this path currently exist?
Returns the time of the last modification. Accurate to whatever the OS supports.
Returns the time of the last access. Accurate to whatever the OS supports.
Returns the time of file creation. Accurate to whatever the OS supports.
Return the file length (in bytes).
Is this file writable?
Is this file actually a folder/directory?
Return timestamp information.
Models a file path. These are expected to be used as the constructor argument to various file classes. The intention is that they easily convert to other representations such as absolute, canonical, or Url.
File paths containing non-ansi characters should be UTF-8 encoded. Supporting Unicode in this manner was deemed to be more suitable than providing a wchar version of FilePath, and is both consistent & compatible with the approach taken with the Uri class.
FilePath is designed to be transformed, thus each mutating method modifies the internal content. See module Path.d for a lightweight immutable variation.
Note that patterns of adjacent '.' separators are treated specially in that they will be assigned to the name where there is no distinct suffix. In addition, a '.' at the start of a name signifies it does not belong to the suffix i.e. ".file" is a name rather than a suffix. Patterns of intermediate '.' characters will otherwise be assigned to the suffix, such that "file....suffix" includes the dots within the suffix itself. See method ext() for a suffix without dots.
Note that Win32 '\' characters are converted to '/' by default via the FilePath constructor.