datoteka.fs
File System helpers.
create-tempdir
(create-tempdir)
(create-tempdir prefix)
Creates a temp directory on the filesystem.
directory?
(directory? path)
(directory? path params)
Checks if the provided path is a directory.
list-dir
(list-dir path)
(list-dir path glob)
Return a lazy seq of files and directories found under the provided directory. The order of files is not guarrantied.
NOTE: the seq should be fully realized in order to properly release all acquired resources for this operation. Converting it to vector is an option for do it.
make-permissions
(make-permissions expr)
Generate a array of FileAttribute
instances generated from rwxr-xr-x
kind of expressions.
move
(move src dst)
(move src dst flags)
Move or rename a file to a target file.
By default, this method attempts to move the file to the target file, failing if the target file exists except if the source and target are the same file, in which case this method has no effect. If the file is a symbolic link then the symbolic link itself, not the target of the link, is moved.
This method may be invoked to move an empty directory. When invoked to move a directory that is not empty then the directory is moved if it does not require moving the entries in the directory. For example, renaming a directory on the same FileStore will usually not require moving the entries in the directory. When moving a directory requires that its entries be moved then this method fails (by throwing an IOException).
name
(name path)
Return a path representing the name of the file or directory, or null if this path has zero elements.
permissions
(permissions path)
(permissions path params)
Returns the string representation of the permissions of the provided path.
regular-file?
(regular-file? path)
(regular-file? path params)
Checks if the provided path is a plain file.
tempfile
(tempfile & {:keys [suffix prefix max-retries], :or {suffix ".tmp", max-retries 1000, prefix "datoteka."}})
Retrieves a candidate tempfile (without creating it).