(atomic-write path write-function)
(atomic-write path write-function permissions)
Write to a file atomically. This takes a function that should operate on a Writer as its first argument. If permissions are specified (as a string of the form "rwxrwxrwx") then the file will be created with those permissions. If not specified and the file already exists then existing permissions will be preserved. If no file exist a default is set.
Write to a file atomically. This takes a function that should operate on a Writer as its first argument. If permissions are specified (as a string of the form "rwxrwxrwx") then the file will be created with those permissions. If not specified and the file already exists then existing permissions will be preserved. If no file exist a default is set.
(atomic-write-string path string)
(atomic-write-string path string permissions)
Write a string to a file atomically. See atomic-write for more details.
Write a string to a file atomically. See atomic-write for more details.
(delete-recursively path-to-delete)
Given a path to a directory, delete everything in the directory recursively.
Given a path to a file, it will delete that file.
Returns true if successful, false if not. Failures are logged at the info level.
Uses a stack
based tail recursion method to avoid using a recursive stack
Given a path to a directory, delete everything in the directory recursively. Given a path to a file, it will delete that file. Returns true if successful, false if not. Failures are logged at the info level. Uses a `stack` based tail recursion method to avoid using a recursive stack
(get-perms path)
Returns the currently set permissions of the given file path.
Returns the currently set permissions of the given file path.
(set-perms path permissions)
Set the provided permissions on the given path. The permissions string is in the form of the standard 9 character posix format, e.g. "rwxr-xr-x".
Set the provided permissions on the given path. The permissions string is in the form of the standard 9 character posix format, e.g. "rwxr-xr-x".
(untar-file path-to-tar-file output-directory)
Given a path to a tar file, and a path to the parent directory to untar the repo in, recreate the contents of the tar file Note: does not recreate original permissions, or support symlinks.
Given a path to a tar file, and a path to the parent directory to untar the repo in, recreate the contents of the tar file Note: does not recreate original permissions, or support symlinks.
(unzip-file input-file output-file)
Given a path to an input file, and a path to an output location, attempt to unzip the file. Will not overwrite the same path with the output
Given a path to an input file, and a path to an output location, attempt to unzip the file. Will not overwrite the same path with the output
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close