pathlib

Public Imports

std.file
public import std.file : SpanMode;

Members

Aliases

Path
alias Path = WindowsPath

Set the default path depending on the current platform.

Path
alias Path = PosixPath
Undocumented in source.
copyToIfNewer
alias copyToIfNewer = copyTo!( (src, dest))
Undocumented in source.

Classes

PathException
class PathException

Exception that will be thrown when any path operations fail.

Functions

absolute
auto absolute(PathType p, PathType parent)
Undocumented in source. Be warned that the author may not have intended to support it.
appendFile
void appendFile(Path p, void[] buffer)
asNormalizedPath
auto asNormalizedPath(SrcType p)
Undocumented in source. Be warned that the author may not have intended to support it.
asPosixPath
auto asPosixPath(PathType p)
Undocumented in source. Be warned that the author may not have intended to support it.
asWindowsPath
auto asWindowsPath(PathType p)
Undocumented in source. Be warned that the author may not have intended to support it.
assertEmpty
void assertEmpty(A a, StringType fmt)
Undocumented in source. Be warned that the author may not have intended to support it.
assertEqual
void assertEqual(A a, B b, StringType fmt)
Undocumented in source. Be warned that the author may not have intended to support it.
assertNotEmpty
void assertNotEmpty(A a, StringType fmt)
Undocumented in source. Be warned that the author may not have intended to support it.
assertNotEqual
void assertNotEqual(A a, B b, StringType fmt)
Undocumented in source. Be warned that the author may not have intended to support it.
chdir
void chdir(Path p)
Undocumented in source. Be warned that the author may not have intended to support it.
copyFileTo
void copyFileTo(Path src, Path dest)

Copy a file to some destination. If the destination exists and is a file, it is overwritten. If it is an existing directory, the actual destination will be ($D dest ~ src.name). Behaves like std.file.copy except that dest does not have to be a file.

copyTo
void copyTo(Path src, Path dest)

Copy a file or directory to a target file or directory.

currentExePath
Path currentExePath()

The path to the current executable.

cwd
Path cwd()

The absolute path to the current working directory with symlinks and friends resolved.

drive
auto drive(PathType p)

The drive of the path p. Note: Non-Windows platforms have no concept of "drives".

exists
bool exists(Path p)

Whether the path exists or not. It does not matter whether it is a file or not.

extension
auto extension(PathType p)

The extension of the path including the leading dot.

extensions
auto extensions(PathType p)

All extensions of the path.

fullExtension
auto fullExtension(PathType p)

The full extension of the path.

glob
auto glob(Path p, PatternType pattern, SpanMode spanMode)

Generate an input range of Paths that match the given pattern.

isAbsolute
auto isAbsolute(PathType p)

Whether the path is absolute.

isDir
bool isDir(Path p)

Whether the path is an existing directory.

isDot
bool isDot(StringType str)

Whether str can be represented by ".".

isDot
auto isDot(PathType p)

Whether the path is either "" or ".".

isFile
bool isFile(Path p)

Whether the path is an existing file.

isSymlink
bool isSymlink(Path p)

Whether the given path p points to a symbolic link (or junction point in Windows).

logDebug
void logDebug(T args)
Undocumented in source. Be warned that the author may not have intended to support it.
match
auto match(PathType p, Pattern pattern)

Whether the given path matches the given glob-style pattern

mkdir
void mkdir(Path p, bool parents)
name
auto name(PathType p)

The name of the path without any of its parents.

normalizedData
auto normalizedData(PathType p)

Remove duplicate directory separators and stand-alone dots, on a textual basis. Does not resolve ".."s in paths, since this would be wrong when dealing with symlinks. Given the symlink "/foo" pointing to "/what/ever", the path "/foo/../baz.exe" would 'physically' be "/what/baz.exe". If "/foo" was no symlink, the actual path would be "/baz.exe".

open
auto open(Path p, char[] openMode)
Undocumented in source. Be warned that the author may not have intended to support it.
parent
auto parent(PathType p)
Undocumented in source. Be warned that the author may not have intended to support it.
parents
auto parents(PathType p)

/foo/bar/baz/hurr.durr => { Path("/foo/bar/baz"), Path("/foo/bar"), Path("/foo"), Path("/") }

parts
auto parts(PathType p)
posixData
auto posixData(PathType p)
readFile
auto readFile(Path p)
readFile
auto readFile(Path p)
Undocumented in source. Be warned that the author may not have intended to support it.
relativeTo
auto relativeTo(PathType p, PathType parent)

Create a path from p that is relative to parent.

remove
void remove(Path p, bool recursive)

Remove path from filesystem. Similar to unix rm. If the path is a dir, will reecursively remove all subdirs by default.

resolved
Path resolved(Path p)
Undocumented in source. Be warned that the author may not have intended to support it.
root
auto root(PathType p)
stem
auto stem(PathType p)

The name of the path without its extension.

windowsData
auto windowsData(PathType p)
writeFile
void writeFile(Path p, void[] buffer)

Mixin templates

PathCommon
mixintemplate PathCommon(TheStringType, alias theSeparator, alias theCaseSensitivity)
Undocumented in source.

Structs

PosixPath
struct PosixPath
Undocumented in source.
ScopedChdir
struct ScopedChdir

Helper struct to change the directory for the current scope.

WindowsPath
struct WindowsPath
Undocumented in source.

Templates

isSomePath
template isSomePath(PathType)
Undocumented in source.

Meta

Authors

Manuzor

ToDo: - Path().open(...)