Module scriptlike.file.extras
Scriptlike v0.10.3
Extra Scriptlike-only functionality to complement std.file
.
Functions
Name | Description |
---|---|
existsAsDir(path)
|
Checks if the path exists as a directory. |
existsAsFile(path)
|
Checks if the path exists as a file. |
existsAsSymlink(path)
|
Checks if the path exists as a symlink. |
isGroupExec(path)
|
Posix-only. Check the group executable bit of a file. File must exist. |
isGroupExec(path)
|
Posix-only. Check the group executable bit of a file. File must exist. |
isUserExec(path)
|
Posix-only. Check the user (ie "owner") executable bit of a file. File must exist. |
isUserExec(path)
|
Posix-only. Check the user (ie "owner") executable bit of a file. File must exist. |
isWorldExec(path)
|
Posix-only. Check the world (ie "other") executable bit of a file. File must exist. |
isWorldExec(path)
|
Posix-only. Check the world (ie "other") executable bit of a file. File must exist. |
removePath(name)
|
Delete name regardless of whether it's a file or directory.
If it's a directory, it's deleted recursively, via
rmdirRecurse . Throws if the file/directory doesn't exist.
|
tryCopy(from, to)
|
If 'from' exists, then copy. Otherwise, do nothing and return false. |
tryMkdir(name)
|
If 'name' doesn't already exist, then mkdir. Otherwise, do nothing and return false. |
tryMkdirRecurse(name)
|
If 'name' doesn't already exist, then mkdirRecurse. Otherwise, do nothing and return false. |
tryRemove(name)
|
If 'name' exists, then remove. Otherwise, do nothing and return false. |
tryRemovePath(name)
|
If name exists, then delete it regardless of whether it's a file or
directory. If it doesn't already exist, do nothing and return false.
|
tryRename(from, to)
|
If 'from' exists, then rename. Otherwise, do nothing and return false. |
tryRmdir(name)
|
If 'name' exists, then rmdir. Otherwise, do nothing and return false. |
tryRmdirRecurse(name)
|
If 'name' exists, then rmdirRecurse. Otherwise, do nothing and return false. |
trySymlink(original, link)
|
Posix-only. If 'original' exists, then symlink. Otherwise, do nothing and return false. |