scriptlike.path

Undocumented in source.

Members

Aliases

Args
alias Args = ArgsT!char
Undocumented in source.
CaseSensitive
alias CaseSensitive = std.path.CaseSensitive
Undocumented in source.
DExt
alias DExt = ExtT!dchar
Undocumented in source.
Ext
alias Ext = ExtT!char
Undocumented in source.
FileException
alias FileException = std.file.FileException

Part of workaround for DMD Issue #12111

Path
alias Path = PathT!char
Undocumented in source.
SpanMode
alias SpanMode = std.file.SpanMode
Undocumented in source.
WExt
alias WExt = ExtT!wchar
Undocumented in source.
attrIsDir
alias attrIsDir = std.file.attrIsDir
Undocumented in source.
attrIsFile
alias attrIsFile = std.file.attrIsFile
Undocumented in source.
attrIsSymlink
alias attrIsSymlink = std.file.attrIsSymlink
Undocumented in source.
buildNormalizedPath
alias buildNormalizedPath = std.path.buildNormalizedPath
Undocumented in source.
buildPath
alias buildPath = std.path.buildPath
Undocumented in source.
defaultExt
alias defaultExt = defaultExtension
Undocumented in source.
dirSeparator
alias dirSeparator = std.path.dirSeparator

Part of workaround for DMD Issue #12111

extOf
alias extOf = extension

Convenience aliases

getcwd
alias getcwd = std.file.getcwd
Undocumented in source.
isDirSeparator
alias isDirSeparator = std.path.isDirSeparator
Undocumented in source.
osDefaultCaseSensitivity
alias osDefaultCaseSensitivity = std.path.osDefaultCaseSensitivity
Undocumented in source.
pathSeparator
alias pathSeparator = std.path.pathSeparator
Undocumented in source.
runShell
alias runShell = tryRun

Backwards-compatibility alias. runShell may become depricated in the future, so you should use tryRun or run insetad.

scriptlikeTraceCommands
alias scriptlikeTraceCommands = scriptlikeEcho

Alias for backwards-compatibility. This will be deprecated in the future. You should use scriptlikeEcho insetad.

setExt
alias setExt = setExtension
Undocumented in source.
stripExt
alias stripExt = stripExtension
Undocumented in source.
tempDir
alias tempDir = std.file.tempDir
Undocumented in source.
thisExePath
alias thisExePath = std.file.thisExePath
Undocumented in source.

Classes

ErrorLevelException
class ErrorLevelException

Indicates a command returned a non-zero errorlevel.

Functions

absolutePath
PathT!C absolutePath(PathT!C path, string base)
PathT!C absolutePath(PathT!C path, PathT!C base)

Just like std.path.absolutePath, but operates on Path.

absolutePath
string absolutePath(string path, string base)

Part of workaround for DMD Issue #12111

append
void append(PathT!C name, void[] buffer)
void append(char[] name, void[] buffer)

Just like std.file.append, but optionally takes a Path, and obeys scriptlikeEcho and scriptlikeDryRun.

baseName
PathT!C baseName(PathT!C path)
PathT!C baseName(PathT!C path, C1[] suffix)

Just like std.path.baseName, but operates on Path.

baseName
inout(C)[] baseName(inout(C)[] path)
inout(C)[] baseName(inout(C)[] path, C1[] suffix)

Part of workaround for DMD Issue #12111

buildNormalizedPathFixed
immutable(C)[] buildNormalizedPathFixed(const(C[])[] paths)

Like buildNormalizedPath, but if the result is the current directory, this returns "." instead of "". However, if all the inputs are "", or there are no inputs, this still returns "" just like buildNormalizedPath.

chdir
void chdir(char[] pathname)

Just like std.file.chdir, but echoes if scriptlikeEcho is true.

chdir
void chdir(PathT!C pathname)

Just like std.file.chdir, but takes a Path, and echoes if scriptlikeEcho is true.

copy
void copy(char[] from, char[] to)
void copy(PathT!C from, char[] to)
void copy(char[] from, PathT!C to)

Just like std.file.copy, but optionally takes Path, and obeys scriptlikeEcho and scriptlikeDryRun.

copy
void copy(PathT!C from, PathT!C to)

Just like std.file.copy, but optionally takes Path, and obeys scriptlikeEcho and scriptlikeDryRun.

defaultExtension
PathT!C defaultExtension(PathT!C path, C2[] ext)
PathT!C defaultExtension(PathT!C path, ExtT!C ext)

Just like std.path.defaultExtension, but operates on Path and optionally Ext.

defaultExtension
immutable(Unqual!C1)[] defaultExtension(C1[] path, C2[] ext)
dirEntries
auto dirEntries(string path, string pattern, SpanMode mode, bool followSymlink)

Part of workaround for DMD Issue #12111

dirEntries
auto dirEntries(string path, SpanMode mode, bool followSymlink)

Part of workaround for DMD Issue #12111

dirEntries
auto dirEntries(PathT!C path, string pattern, SpanMode mode, bool followSymlink)

Just like std.file.dirEntries, but takes a Path.

dirEntries
auto dirEntries(PathT!C path, SpanMode mode, bool followSymlink)

Just like std.file.dirEntries, but takes a Path.

dirName
PathT!C dirName(PathT!C path)

Just like std.path.dirName, but operates on Path.

dirName
C[] dirName(C[] path)

Part of workaround for DMD Issue #12111

driveName
PathT!C driveName(PathT!C path)

Just like std.path.driveName, but operates on Path.

driveName
inout(C)[] driveName(inout(C)[] path)

Part of workaround for DMD Issue #12111

escapeShellArg
string escapeShellArg(T str)

Properly escape arguments containing spaces for the command shell, if necessary.

exists
bool exists(char[] name)

Part of workaround for DMD Issue #12111

exists
bool exists(PathT!C name)

Just like std.file.exists, but takes a Path.

existsAsDir
bool existsAsDir(char[] path)
bool existsAsDir(PathT!C path)

Checks if the path exists as a directory.

existsAsFile
bool existsAsFile(char[] path)
bool existsAsFile(PathT!C path)

Checks if the path exists as a file.

existsAsSymlink
bool existsAsSymlink(char[] path)
bool existsAsSymlink(PathT!C path)

Checks if the path exists as a symlink.

expandTilde
PathT!C expandTilde(PathT!C path)

Just like std.path.expandTilde, but operates on Path.

expandTilde
string expandTilde(string inputPath)

Part of workaround for DMD Issue #12111

extension
ExtT!C extension(PathT!C path)

Just like std.path.extension, but takes a Path and returns an Ext.

extension
inout(C)[] extension(inout(C)[] path)

Part of workaround for DMD Issue #12111

filenameCharCmp
int filenameCharCmp(dchar a, dchar b)

Part of workaround for DMD Issue #12111

filenameCmp
int filenameCmp(PathT!C path, PathT!C2 filename2)
int filenameCmp(PathT!C path, const(C2)[] filename2)
int filenameCmp(const(C)[] path, PathT!C2[] filename2)

Just like std.path.filenameCmp, but operates on Path.

filenameCmp
int filenameCmp(const(C1)[] filename1, const(C2)[] filename2)

Part of workaround for DMD Issue #12111

getAttributes
uint getAttributes(char[] name)

Part of workaround for DMD Issue #12111

getAttributes
uint getAttributes(PathT!C name)

Just like std.file.getAttributes, but takes a Path.

getLinkAttributes
uint getLinkAttributes(char[] name)

Part of workaround for DMD Issue #12111

getLinkAttributes
uint getLinkAttributes(PathT!C name)

Just like std.file.getLinkAttributes, but takes a Path.

getSize
ulong getSize(char[] name)

Part of workaround for DMD Issue #12111

getSize
ulong getSize(PathT!C name)

Just like std.file.getSize, but takes a Path.

getTimes
void getTimes(char[] name, SysTime accessTime, SysTime modificationTime)

Part of workaround for DMD Issue #12111

getTimes
void getTimes(PathT!C name, SysTime accessTime, SysTime modificationTime)

Just like std.file.getTimes, but takes a Path.

getTimesWin
void getTimesWin(char[] name, SysTime fileCreationTime, SysTime fileAccessTime, SysTime fileModificationTime)
Undocumented in source. Be warned that the author may not have intended to support it.
getTimesWin
void getTimesWin(char[] name, SysTime fileCreationTime, SysTime fileAccessTime, SysTime fileModificationTime)

Windows-only. Part of workaround for DMD Issue #12111

getTimesWin
void getTimesWin(PathT!C name, SysTime fileCreationTime, SysTime fileAccessTime, SysTime fileModificationTime)
Undocumented in source. Be warned that the author may not have intended to support it.
getTimesWin
void getTimesWin(PathT!C name, SysTime fileCreationTime, SysTime fileAccessTime, SysTime fileModificationTime)

Windows-only. Just like std.file.getTimesWin, but takes a Path.

globMatch
bool globMatch(PathT!C path, const(C)[] pattern)

Just like std.path.globMatch, but operates on Path.

globMatch
bool globMatch(const(C)[] path, const(C)[] pattern)

Part of workaround for DMD Issue #12111

isAbsolute
bool isAbsolute(PathT!C path)

Just like std.path.isAbsolute, but operates on Path.

isAbsolute
bool isAbsolute(C[] path)

Part of workaround for DMD Issue #12111

isRooted
bool isRooted(PathT!C path)

Just like std.path.isRooted, but operates on Path.

isRooted
bool isRooted(C[] path)

Part of workaround for DMD Issue #12111

isValidFilename
bool isValidFilename(PathT!C path)

Just like std.path.isValidFilename, but operates on Path.

isValidFilename
bool isValidFilename(C[] filename)

Part of workaround for DMD Issue #12111

isValidPath
bool isValidPath(PathT!C path)

Just like std.path.isValidPath, but operates on Path.

isValidPath
bool isValidPath(C[] path)

Part of workaround for DMD Issue #12111

mkdir
void mkdir(char[] pathname)

Just like std.file.mkdir, but optionally takes a Path, and obeys scriptlikeEcho and scriptlikeDryRun.

mkdir
void mkdir(PathT!C pathname)

Just like std.file.mkdir, but optionally takes a Path, and obeys scriptlikeEcho and scriptlikeDryRun.

mkdirRecurse
void mkdirRecurse(char[] pathname)

Just like std.file.mkdirRecurse, but optionally takes a Path, and obeys scriptlikeEcho and scriptlikeDryRun.

mkdirRecurse
void mkdirRecurse(PathT!C pathname)

Just like std.file.mkdirRecurse, but optionally takes a Path, and obeys scriptlikeEcho and scriptlikeDryRun.

pathSplitter
auto pathSplitter(PathT!C path)

Just like std.path.pathSplitter. Note this returns a range of strings, not a range of Path.

pathSplitter
ReturnType!(std.path.pathSplitter!C) pathSplitter(const(C)[] path)

Part of workaround for DMD Issue #12111

read
void[] read(char[] name, size_t upTo)

Part of workaround for DMD Issue #12111

read
void[] read(PathT!C name, size_t upTo)

Just like std.file.read, but takes a Path.

readLink
PathT!C readLink(PathT!C link)

Posix-only. Just like std.file.readLink, but operates on Path.

readLink
string readLink(const(C)[] link)

Posix-only. Part of workaround for DMD Issue #12111

readLink
PathT!C readLink(PathT!C link)
Undocumented in source. Be warned that the author may not have intended to support it.
readLink
string readLink(const(C)[] link)
Undocumented in source. Be warned that the author may not have intended to support it.
readText
S readText(char[] name)

Part of workaround for DMD Issue #12111

relativePath
string relativePath(string path, string base)

Part of workaround for DMD Issue #12111

relativePath
PathT!C relativePath(PathT!C path, PathT!C base)

Just like std.path.relativePath, but operates on Path.

relativePath
PathT!C relativePath(PathT!C path, string base)

Just like std.path.relativePath, but operates on Path.

remove
void remove(PathT!C name)
void remove(char[] name)

Just like std.file.remove, but optionally takes a Path, and obeys scriptlikeEcho and scriptlikeDryRun.

rename
void rename(PathT!C from, char[] to)
void rename(char[] from, char[] to)

Just like std.file.rename, but optionally takes Path, and obeys scriptlikeEcho and scriptlikeDryRun.

rename
void rename(PathT!C from, PathT!C to)
void rename(char[] from, PathT!C to)

Just like std.file.rename, but optionally takes Path, and obeys scriptlikeEcho and scriptlikeDryRun.

rmdir
void rmdir(PathT!C pathname)
void rmdir(char[] pathname)

Just like std.file.rmdir, but optionally takes a Path, and obeys scriptlikeEcho and scriptlikeDryRun.

rmdirRecurse
void rmdirRecurse(PathT!C pathname)
void rmdirRecurse(char[] pathname)

Just like std.file.rmdirRecurse, but optionally takes a Path, and obeys scriptlikeEcho and scriptlikeDryRun.

rootName
inout(C)[] rootName(inout(C)[] path)

Part of workaround for DMD Issue #12111

rootName
PathT!C rootName(PathT!C path)

Just like std.path.rootName, but operates on Path.

run
void run(PathT!C workingDirectory, string command)

Runs a command, through the system's command shell interpreter, in typical shell-script style: Synchronously, with the command's stdout/in/err automatically forwarded through your program's stdout/in/err.

run
void run(string command)

Runs a command, through the system's command shell interpreter, in typical shell-script style: Synchronously, with the command's stdout/in/err automatically forwarded through your program's stdout/in/err.

setExtension
immutable(C1)[] setExtension(immutable(C1)[] path, const(C2)[] ext)

Part of workaround for DMD Issue #12111

setExtension
immutable(Unqual!C1)[] setExtension(C1[] path, C2[] ext)

Part of workaround for DMD Issue #12111

setExtension
PathT!C setExtension(PathT!C path, ExtT!C ext)

Just like std.path.setExtension, but operates on Path.

setExtension
PathT!C setExtension(PathT!C path, const(C2)[] ext)

Just like std.path.setExtension, but operates on Path.

setTimes
void setTimes(PathT!C name, SysTime accessTime, SysTime modificationTime)
void setTimes(char[] name, SysTime accessTime, SysTime modificationTime)

Just like std.file.setTimes, but optionally takes a Path, and obeys scriptlikeEcho and scriptlikeDryRun.

slurp
Select!(Types.length == 1, Types[0][], Tuple!(Types)[]) slurp(string filename, char[] format)

Part of workaround for DMD Issue #12111

stripDrive
inout(C)[] stripDrive(inout(C)[] path)

Part of workaround for DMD Issue #12111

stripDrive
PathT!C stripDrive(PathT!C path)

Just like std.path.stripDrive, but operates on Path.

stripExtension
inout(C)[] stripExtension(inout(C)[] path)

Part of workaround for DMD Issue #12111

stripExtension
PathT!C stripExtension(PathT!C path)

Just like std.path.stripExtension, but operates on Path.

symlink
void symlink(PathT!C1 original, PathT!C2 link)
void symlink(const(C1)[] original, PathT!C2 link)
void symlink(PathT!C1 original, const(C2)[] link)
void symlink(const(C1)[] original, const(C2)[] link)

Posix-only. Just like std.file.symlink, but optionally takes Path, and obeys scriptlikeEcho and scriptlikeDryRun.

symlink
void symlink(PathT!C1 original, PathT!C2 link)
Undocumented in source. Be warned that the author may not have intended to support it.
symlink
void symlink(const(C1)[] original, PathT!C2 link)
Undocumented in source. Be warned that the author may not have intended to support it.
symlink
void symlink(PathT!C1 original, const(C2)[] link)
Undocumented in source. Be warned that the author may not have intended to support it.
symlink
void symlink(const(C1)[] original, const(C2)[] link)
Undocumented in source. Be warned that the author may not have intended to support it.
timeLastModified
SysTime timeLastModified(PathT!C name)

Just like std.file.timeLastModified, but takes a Path.

timeLastModified
SysTime timeLastModified(PathT!C name, SysTime returnIfMissing)

Just like std.file.timeLastModified, but takes a Path.

timeLastModified
SysTime timeLastModified(char[] name)
SysTime timeLastModified(char[] name, SysTime returnIfMissing)

Part of workaround for DMD Issue #12111

tryCopy
bool tryCopy(T1 from, T2 to)

If 'from' exists, then copy. Otherwise do nothing. Obeys scriptlikeEcho and scriptlikeDryRun.

tryMkdir
bool tryMkdir(T name)

If 'name' doesn't already exist, then mkdir. Otherwise do nothing. Obeys scriptlikeEcho and scriptlikeDryRun.

tryMkdirRecurse
bool tryMkdirRecurse(T name)

If 'name' doesn't already exist, then mkdirRecurse. Otherwise do nothing. Obeys scriptlikeEcho and scriptlikeDryRun.

tryRemove
bool tryRemove(T name)

If 'name' exists, then remove. Otherwise do nothing. Obeys scriptlikeEcho and scriptlikeDryRun.

tryRename
bool tryRename(T1 from, T2 to)

If 'from' exists, then rename. Otherwise do nothing. Obeys scriptlikeEcho and scriptlikeDryRun.

tryRmdir
bool tryRmdir(T name)

If 'name' exists, then rmdir. Otherwise do nothing. Obeys scriptlikeEcho and scriptlikeDryRun.

tryRmdirRecurse
bool tryRmdirRecurse(T name)

If 'name' exists, then rmdirRecurse. Otherwise do nothing. Obeys scriptlikeEcho and scriptlikeDryRun.

tryRun
int tryRun(PathT!C workingDirectory, string command)

Runs a command, through the system's command shell interpreter, in typical shell-script style: Synchronously, with the command's stdout/in/err automatically forwarded through your program's stdout/in/err.

tryRun
int tryRun(string command)

Runs a command, through the system's command shell interpreter, in typical shell-script style: Synchronously, with the command's stdout/in/err automatically forwarded through your program's stdout/in/err.

trySymlink
bool trySymlink(T1 original, T2 link)

Posix-only. If 'original' exists, then symlink. Otherwise do nothing. Obeys scriptlikeEcho and scriptlikeDryRun.

trySymlink
bool trySymlink(T1 original, T2 link)
Undocumented in source. Be warned that the author may not have intended to support it.
write
void write(char[] name, void[] buffer)

Just like std.file.write, but optionally takes a Path, and obeys scriptlikeEcho and scriptlikeDryRun.

write
void write(PathT!C name, void[] buffer)

Just like std.file.write, but optionally takes a Path, and obeys scriptlikeEcho and scriptlikeDryRun.

Properties

isDir
bool isDir [@property getter]

Just like std.file.isDir, but takes a Path.

isDir
bool isDir [@property getter]

Part of workaround for DMD Issue #12111

isFile
bool isFile [@property getter]

Just like std.file.isFile, but takes a Path.

isFile
bool isFile [@property getter]

Part of workaround for DMD Issue #12111

isSymlink
bool isSymlink [@property getter]

Just like std.file.isSymlink, but takes a Path.

isSymlink
bool isSymlink [@property getter]

Part of workaround for DMD Issue #12111

Structs

ArgsT
struct ArgsT(C = char)

Much like std.array.Appender!string, but specifically geared towards building a command string out of arguments. String and Path can both be appended. All elements added will automatically be escaped, and separated by spaces, as necessary.

ExtT
struct ExtT(C = char)

Represents a file extension.

PathT
struct PathT(C = char)

Represents a filesystem path. The path is always kept normalized automatically (as performed by buildNormalizedPathFixed).

Templates

readText
template readText(S = string)

Just like std.file.readText, but takes a Path.

slurp
template slurp(Types...)

Just like std.file.slurp, but takes a Path.

Variables

scriptlikeCustomEcho
void delegate(string) scriptlikeCustomEcho;

By default, scriptlikeEcho and scriptlikeDryRun echo to stdout. You can override this behavior by setting scriptlikeCustomEcho to your own sink delegate. Set this to null to go back to Scriptlike's default of "echo to stdout" again.

scriptlikeDryRun
bool scriptlikeDryRun;

If true, then run, tryRun, file write, file append, and all the echoable commands that modify the filesystem will be echoed to stdout (regardless of scriptlikeEcho) and NOT actually executed.

scriptlikeEcho
bool scriptlikeEcho;

If true, all commands will be echoed. By default, they will be echoed to stdout, but you can override this with scriptlikeCustomEcho.

Meta