Module scriptlike.file

Functions

Name Description
append Just like std.file.append, but optionally takes a Path,
chdir Just like std.file.chdir, but takes a Path, and echoes if scriptlikeEcho is true.
chdir Just like std.file.chdir, but echoes if scriptlikeEcho is true.
copy Just like std.file.copy, but optionally takes Path,
dirEntries Just like std.file.dirEntries, but takes a Path.
echoCommand Output a (lazy) string through scriptlike's echo logger.
exists Just like std.file.exists, but takes a Path.
existsAsDir Checks if the path exists as a directory.
existsAsFile Checks if the path exists as a file.
existsAsSymlink Checks if the path exists as a symlink.
getAttributes Just like std.file.getAttributes, but takes a Path.
getcwd Just like std.file.getcwd, but returns a Path.
getLinkAttributes Just like std.file.getLinkAttributes, but takes a Path.
getSize Just like std.file.getSize, but takes a Path.
getTimes Just like std.file.getTimes, but takes a Path.
isDir Just like std.file.isDir, but takes a Path.
isFile Just like std.file.isFile, but takes a Path.
isSymlink Just like std.file.isSymlink, but takes a Path.
mkdir Just like std.file.mkdir, but optionally takes a Path,
mkdirRecurse Just like std.file.mkdirRecurse, but optionally takes a Path,
read Just like std.file.read, but takes a Path.
readLink
readText Just like std.file.readText, but takes a Path.
remove Just like std.file.remove, but optionally takes a Path,
rename Just like std.file.rename, but optionally takes Path,
rmdir Just like std.file.rmdir, but optionally takes a Path,
rmdirRecurse Just like std.file.rmdirRecurse, but optionally takes a Path,
setTimes Just like std.file.setTimes, but optionally takes a Path,
slurp Just like std.file.slurp, but takes a Path.
symlink
symlink
symlink
symlink
tempDir Just like std.file.tempDir, but returns a Path.
thisExePath Just like std.file.thisExePath, but returns a Path.
timeLastModified Just like std.file.timeLastModified, but takes a Path.
tryCopy If 'from' exists, then copy. Otherwise do nothing.
tryMkdir If 'name' doesn't already exist, then mkdir. Otherwise do nothing.
tryMkdirRecurse If 'name' doesn't already exist, then mkdirRecurse. Otherwise do nothing.
tryRemove If 'name' exists, then remove. Otherwise do nothing.
tryRename If 'from' exists, then rename. Otherwise do nothing.
tryRmdir If 'name' exists, then rmdir. Otherwise do nothing.
tryRmdirRecurse If 'name' exists, then rmdirRecurse. Otherwise do nothing.
trySymlink
write Just like std.file.write, but optionally takes a Path,

Global variables

Name Type Description
scriptlikeCustomEcho void delegate(string) 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 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 If true, all commands will be echoed. By default, they will be

Aliases

Name Type Description
scriptlikeTraceCommands Alias for backwards-compatibility. This will be deprecated in the future.

Authors

Nick Sabalausky

Copyright

Copyright (C) 2014-2015 Nick Sabalausky

License

zlib/libpng