Liking cljdoc? Tell your friends :D
Clojure only.

local-fs.core

File system utilities in clojure.

File system utilities in clojure.
raw docstring

*cwd*clj

Current working directory. This cannot be changed in the JVM. Changing this will only change the working directory for functions in this library.

Current working directory. This cannot be changed in the JVM.
Changing this will only change the working directory for functions
in this library.
raw docstring

->copy-optionsclj

(->copy-options)
(->copy-options {:keys [replace-existing atomic-move copy-attributes
                        nofollow-links]})

Converts a hash-map of options into an array of CopyOption objects. | key | description | | -------------------|-------------| | :replace-existing| Adds StandardCopyOption/REPLACE_EXISTING to the array. Default: false | :atomic-move | Adds StandardCopyOption/ATOMIC_MOVE to the array. Default: false | :copy-attributes | Adds StandardCopyOption/COPY_ATTRIBUTES to the array. Default: false | :nofollow-links | Adds LinkOption/NOFOLLOW_LINKS to the array. Default: false

Converts a hash-map of options into an array of CopyOption objects.
| key                | description |
| -------------------|-------------|
| `:replace-existing`| Adds StandardCopyOption/REPLACE_EXISTING to the array. Default: `false`
| `:atomic-move`     | Adds StandardCopyOption/ATOMIC_MOVE to the array. Default: `false`
| `:copy-attributes` | Adds StandardCopyOption/COPY_ATTRIBUTES to the array. Default: `false`
| `:nofollow-links`  | Adds LinkOption/NOFOLLOW_LINKS to the array. Default: `false`
raw docstring

->file-attributesclj

(->file-attributes)
(->file-attributes {:keys [posix-file-permissions]})

Converts a seq of file-attributes into an array of FileAttribute objects.

Converts a seq of file-attributes into an array of FileAttribute objects.
raw docstring

(->link-options)
(->link-options {:keys [nofollow-links]})

Converts a hash-map of options into an array of LinkOption objects. | key | description | | -----------------|-------------| | :nofollow-links| Adds LinkOption/NOFOLLOW_LINKS to the array. Default: false

Converts a hash-map of options into an array of LinkOption objects.
| key              | description |
| -----------------|-------------|
| `:nofollow-links`| Adds LinkOption/NOFOLLOW_LINKS to the array. Default: `false`
raw docstring

->posix-file-permissionsclj

(->posix-file-permissions permissions)

absoluteclj

(absolute path)

Return absolute file.

Return absolute file.
raw docstring

absolute-pathclj

(absolute-path path)

absolute-path?clj

(absolute-path? path)

append-to-fileclj

(append-to-file path content)

as-fileclj

(as-file path & paths)

as-pathclj

(as-path path & paths)

base-nameclj

(base-name path)
(base-name path trim-ext)

Return the base name (final segment/file part) of a path. If optional trim-ext is a string and the path ends with that string, it is trimmed. If trim-ext is true, any extension is trimmed.

Return the base name (final segment/file part) of a `path`.
If optional `trim-ext` is a string and the `path` ends with that
string, it is trimmed.
If `trim-ext` is true, any extension is trimmed.
raw docstring

canonical-pathclj

(canonical-path path)

chdirclj

(chdir path)

set!s the value of *cwd* to path. Only works inside of with-mutable-cwd

set!s the value of `*cwd*` to `path`. Only works inside of
[[with-mutable-cwd]]
raw docstring

child-of?clj

(child-of? p c)

Takes two paths and checks to see if the first path is a parent of the second.

Takes two paths and checks to see if the first path is a parent
of the second.
raw docstring

childrenclj

(children)
(children path)

chmodclj

(chmod mode path)

Change file permissions. Returns path. mode can be a permissions string in octal or symbolic format. Symbolic: any combination of r (readable) w (writable) and x (executable). It should be prefixed with + to set or - to unset. And optional prefix of u causes the permissions to be set for the owner only. Octal: a string of three octal digits representing user, group, and world permissions. The three bits of each digit signify read, write, and execute permissions (in order of significance). Note that group and world permissions must be equal. Examples:

(chmod "+x" "/tmp/foo") ; Sets executable for everyone
(chmod "u-wx" "/tmp/foo") ; Unsets owner write and executable
Change file permissions. Returns path.
`mode` can be a permissions string in octal or symbolic format.
Symbolic: any combination of `r` (readable) `w` (writable) and
`x` (executable). It should be prefixed with `+` to set or `-` to
unset. And optional prefix of `u` causes the permissions to be set
for the owner only.
Octal: a string of three octal digits representing user, group, and
world permissions. The three bits of each digit signify read, write,
and execute permissions (in order of significance). Note that group
and world permissions must be equal.
Examples:
```
(chmod "+x" "/tmp/foo") ; Sets executable for everyone
(chmod "u-wx" "/tmp/foo") ; Unsets owner write and executable
```
raw docstring

copyclj

(copy from to)
(copy from to {:keys [replace-existing copy-attributes nofollow-links]})

copy+clj

(copy+ src dest)

Copy src to dest, create directories if needed.

Copy `src` to `dest`, create directories if needed.
raw docstring

copy-dirclj

(copy-dir from to)

Copy a directory from from to to. If to already exists, copy the directory to a directory with the same name as from within the to directory.

Copy a directory from `from` to `to`. If `to` already exists, copy the directory
to a directory with the same name as `from` within the `to` directory.
raw docstring

copy-dir-intoclj

(copy-dir-into from to)

Copy directory into another directory if destination already exists.

Copy directory into another directory if destination already exists.
raw docstring

copy-file!clj

(copy-file! source dest)

Copy a file from source -> dest.

Copy a file from `source` -> `dest`.
raw docstring

copy-files!clj

(copy-files! source-dir dest-dir)

Copy all files in source-dir to dest-dir. Overwrites existing files if last modified timestamp is not the same as that of the source file — see #11699 for more context.

Copy all files in `source-dir` to `dest-dir`. Overwrites existing files if last modified timestamp is not the same as
that of the source file — see #11699 for more context.
raw docstring

copy-recursivelyclj

(copy-recursively from to)
(copy-recursively from
                  to
                  {:keys [replace-existing copy-attributes nofollow-links]})

createclj

(create f)

Create a new file.

Create a new file.
raw docstring

create-dir-if-not-exists!clj

(create-dir-if-not-exists! path)

Self-explanatory. Create a directory with path if it does not already exist.

Self-explanatory. Create a directory with `path` if it does not already exist.
raw docstring

create-directories!clj

(create-directories! path)
(create-directories! path {:keys [posix-file-permissions]})

Warning: Setting posix-file-permissions on create will not always result in the permissions you specify. This is a limitation of the implementation. To guarantee those permissions you should set the permissions as another step after creating the file.

Warning: Setting posix-file-permissions on create will not always
result in the permissions you specify. This is a limitation of the
implementation. To guarantee those permissions you should set the
permissions as another step after creating the file.
raw docstring

create-directoryclj

(create-directory path)
(create-directory path {:keys [posix-file-permissions]})

Warning: Setting posix-file-permissions on create will not always result in the permissions you specify. This is a limitation of the implementation. To guarantee those permissions you should set the permissions as another step after creating the file.

Warning: Setting posix-file-permissions on create will not always
result in the permissions you specify. This is a limitation of the
implementation. To guarantee those permissions you should set the
permissions as another step after creating the file.
raw docstring

create-fileclj

(create-file path)
(create-file path {:keys [posix-file-permissions content]})

Warning: Setting posix-file-permissions on create will not always result in the permissions you specify. This is a limitation of the implementation. To guarantee those permissions you should set the permissions as another step after creating the file.

Warning: Setting posix-file-permissions on create will not always
result in the permissions you specify. This is a limitation of the
implementation. To guarantee those permissions you should set the
permissions as another step after creating the file.
raw docstring

(create-link link-path target-path)

(create-symlink link-path target-path)

Not allowing posix-file-permissions for file attributes since it is not supported on MacOS or Linux for this operation.

Not allowing posix-file-permissions for file attributes since it is not supported on MacOS
or Linux for this operation.
raw docstring

create-temp-directoryclj

(create-temp-directory prefix)
(create-temp-directory prefix {:keys [posix-file-permissions]})

Warning: Setting posix-file-permissions on create will not always result in the permissions you specify. This is a limitation of the implementation. To guarantee those permissions you should set the permissions as another step after creating the file.

Warning: Setting posix-file-permissions on create will not always
result in the permissions you specify. This is a limitation of the
implementation. To guarantee those permissions you should set the
permissions as another step after creating the file.
raw docstring

create-temp-fileclj

(create-temp-file prefix suffix)
(create-temp-file prefix suffix {:keys [posix-file-permissions content]})

Warning: Setting posix-file-permissions on create will not always result in the permissions you specify. This is a limitation of the implementation. To guarantee those permissions you should set the permissions as another step after creating the file.

Warning: Setting posix-file-permissions on create will not always
result in the permissions you specify. This is a limitation of the
implementation. To guarantee those permissions you should set the
permissions as another step after creating the file.
raw docstring

creation-timeclj

(creation-time path)
(creation-time path {:keys [nofollow-links]})

Get the creation time of a file or directory.

Get the creation time of a file or directory.
raw docstring

default-file-systemclj


deleteclj

(delete path)

delete-dirclj

(delete-dir root)

Delete a directory tree.

Delete a directory tree.
raw docstring

delete-if-existsclj

(delete-if-exists path)

delete-recursivelyclj

(delete-recursively path)
(delete-recursively path {:keys [nofollow-links] :or {nofollow-links true}})

directory?clj

(directory? path)
(directory? path {:keys [nofollow-links]})

do-with-open-path-to-resourceclj

(do-with-open-path-to-resource resource f)

Impl for with-open-path-to-resource.

Impl for `with-open-path-to-resource`.
raw docstring

ephemeral-dirclj

(ephemeral-dir prefix)
(ephemeral-dir prefix suffix)
(ephemeral-dir prefix suffix tries)

Create an ephemeral directory (will be deleted on JVM exit). Returns nil if dir could not be created even after n tries (default 10).

Create an ephemeral directory (will be deleted on JVM exit).
 Returns nil if dir could not be created even after n tries
(default 10).
raw docstring

ephemeral-fileclj

(ephemeral-file prefix)
(ephemeral-file prefix suffix)
(ephemeral-file prefix suffix tries)

Create an ephemeral file (will be deleted on JVM exit). Returns nil if file could not be created even after n tries (default 10).

Create an ephemeral file (will be deleted on JVM exit).
 Returns nil if file could not be created even after n tries
(default 10).
raw docstring

execclj

(exec & body)

Execute a shell command in the current directory

Execute a shell command in the current directory
raw docstring

executable?clj

(executable? path)

exists?clj

(exists? path)
(exists? path {:keys [nofollow-links]})

Return true if path exists.

Return true if `path` exists.
raw docstring

expand-homeclj

(expand-home path)

If path begins with a tilde (~), expand the tilde to the value of the user.home system property. If the path begins with a tilde immediately followed by some characters, they are assumed to be a username. This is expanded to the path to that user's home directory. This is (naively) assumed to be a directory with the same name as the user relative to the parent of the current value of user.home.

If `path` begins with a tilde (`~`), expand the tilde to the value
of the `user.home` system property. If the `path` begins with a
tilde immediately followed by some characters, they are assumed to
be a username. This is expanded to the path to that user's home
directory. This is (naively) assumed to be a directory with the same
name as the user relative to the parent of the current value of
`user.home`.
raw docstring

extensionclj

(extension path)

Return the extension part of a file.

Return the extension part of a file.
raw docstring

extract-dir-from-jarclj

(extract-dir-from-jar jar-dir from to)

Takes the string path of a jar, a dir name inside that jar and a destination dir, and copies the from dir to the to dir.

Takes the string path of a jar, a dir name inside that jar and a destination
dir, and copies the from dir to the to dir.
raw docstring

extract-env-from-archiveclj

(extract-env-from-archive archive-path path-component dest-dir)

Extract the entire contents of a file from a archive (such as a JAR).

Extract the entire contents of a file from a archive (such as a JAR).
raw docstring

fileclj

(file path & paths)

If path is a period, replaces it with cwd and creates a new File object out of it and paths. Or, if the resulting File object does not constitute an absolute path, makes it absolutely by creating a new File object out of the paths and cwd.

If `path` is a period, replaces it with cwd and creates a new File object
out of it and `paths`. Or, if the resulting File object does not constitute
an absolute path, makes it absolutely by creating a new File object out of
the `paths` and cwd.
raw docstring

file-exists-in-archive?clj

(file-exists-in-archive? archive-path & path-components)

True is a file exists in an archive.

True is a file exists in an archive.
raw docstring

file-separatorclj


file-system-forclj

(file-system-for path)

file?clj


filenameclj

(filename path)

files-seqclj

(files-seq path)

Get a sequence of all files in path, presumably a directory or an archive of some sort (like a JAR).

Get a sequence of all files in `path`, presumably a directory or an archive of some sort (like a JAR).
raw docstring

find-filesclj

(find-files path pattern)

Find files matching given pattern.

Find files matching given `pattern`.
raw docstring

find-files*clj

(find-files* path pred)

Find files in path by pred.

Find files in `path` by `pred`.
raw docstring

first-path-segmentclj

(first-path-segment path)

format-colorclj

(format-color color x)
(format-color color format-string & args)

Like format, but colorizes the output. color should be a symbol or keyword like green, red, yellow, blue, cyan, magenta, etc. See the entire list of avaliable colors here.

(format-color :red "Fatal error: %s" error-message)
Like `format`, but colorizes the output. `color` should be a symbol or keyword like `green`, `red`, `yellow`, `blue`,
`cyan`, `magenta`, etc. See the entire list of avaliable
colors [here](https://github.com/ibdknox/colorize/blob/master/src/colorize/core.clj).

    (format-color :red "Fatal error: %s" error-message)
raw docstring

get-attributeclj

(get-attribute path attribute)
(get-attribute path attribute {:keys [nofollow-links]})

get-pathclj

(get-path & path-components)

Get a Path for a file or directory in the default (i.e., system) filesystem named by string path component(s). (get-path "/Users/cam/tservice/tservice/plugins") ;; -> #object[sun.nio.fs.UnixPath 0x4d378139 "/Users/cam/tservice/tservice/plugins"]

Get a `Path` for a file or directory in the default (i.e., system) filesystem named by string path component(s).
(get-path "/Users/cam/tservice/tservice/plugins")
;; -> #object[sun.nio.fs.UnixPath 0x4d378139 "/Users/cam/tservice/tservice/plugins"]
raw docstring

get-posix-file-permissionsclj

(get-posix-file-permissions path)
(get-posix-file-permissions path {:keys [nofollow-links format]})

Get the file permissions of a file or directory.

Get the file permissions of a file or directory.
raw docstring

globclj

(glob pattern)
(glob root pattern)

Returns files matching glob pattern.

Returns files matching glob pattern.
raw docstring

hidden?clj

(hidden? path)

homeclj

(home)
(home user)

With no arguments, returns the current value of the user.home system property. If a user is passed, returns that user's home directory. It is naively assumed to be a directory with the same name as the user located relative to the parent of the current value of user.home.

With no arguments, returns the current value of the `user.home` system
property. If a `user` is passed, returns that user's home directory. It
is naively assumed to be a directory with the same name as the `user`
located relative to the parent of the current value of `user.home`.
raw docstring

iterate-dirclj

(iterate-dir path)

Return a sequence [root dirs files], starting from path in depth-first order

Return a sequence `[root dirs files]`, starting from `path` in depth-first order
raw docstring

join-pathsclj

(join-paths path & paths)

Joins one or more path segments into a single String path object.

Joins one or more path segments into a single String path object.
raw docstring

last-access-timeclj

(last-access-time path)
(last-access-time path {:keys [nofollow-links]})

Get the last access time of a file or directory

Get the last access time of a file or directory
raw docstring

last-modified-timeclj

(last-modified-time path)
(last-modified-time path {:keys [nofollow-links]})

Get the last modified time of a file or directory.

Get the last modified time of a file or directory.
raw docstring

last-path-segmentclj

(last-path-segment path)

list-dirclj

(list-dir path)

List files and directories under path.

List files and directories under `path`.
raw docstring

long-strclj

(long-str & strings)

lookup-groupclj

(lookup-group group-name)
(lookup-group group-name file-system)

lookup-group!clj

(lookup-group! group-name)
(lookup-group! group-name file-system)

lookup-userclj

(lookup-user user-name)
(lookup-user user-name file-system)

lookup-user!clj

(lookup-user! user-name)
(lookup-user! user-name file-system)

mkdirclj

(mkdir path)

Create a directory.

Create a directory.
raw docstring

mkdirsclj

(mkdirs path)

Make directory tree.

Make directory tree.
raw docstring

moveclj

(move from to)
(move from to {:keys [replace-existing atomic-move]})

nameclj

(name path)

Return the name part of a file.

Return the name part of a file.
raw docstring

normalize-pathclj

(normalize-path path)

normalizedclj

(normalized path)

Return normalized (canonical) file.

Return normalized (canonical) file.
raw docstring

ns-pathclj

(ns-path n)

Takes a namespace symbol and creates a path to it. Replaces hyphens with underscores. Assumes the path should be relative to cwd.

Takes a namespace symbol and creates a path to it. Replaces hyphens with
underscores. Assumes the path should be relative to cwd.
raw docstring

parentclj

(parent path)

Return the parent path.

Return the parent path.
raw docstring

parent-pathclj

(parent-path path)

parent-pathsclj

(parent-paths path)

parentsclj

(parents f)

Get all the parent directories of a path.

Get all the parent directories of a path.
raw docstring

path-nsclj

(path-ns path)

Takes a path to a Clojure file and constructs a namespace symbol out of the path.

Takes a `path` to a Clojure file and constructs a namespace symbol
out of the path.
raw docstring

read-all-attributesclj

(read-all-attributes path)
(read-all-attributes path {:keys [nofollow-links]})

read-attributesclj

(read-attributes path attributes)
(read-attributes path attributes {:keys [nofollow-links]})

readable?clj

(readable? path)

regular-file?clj

(regular-file? path)
(regular-file? path {:keys [nofollow-links]})

relative-path?clj

(relative-path? path)

renameclj

(rename old-path new-path)

Rename old-path to new-path. Only works on files.

Rename `old-path` to `new-path`. Only works on files.
raw docstring

safe-copyclj

(safe-copy from to opts)

safe-renameclj

(safe-rename current-path new-name)
(safe-rename current-path new-name {:keys [replace-existing atomic-move]})

same-file?clj

(same-file? path1 path2)

set-attributeclj

(set-attribute path attribute value)
(set-attribute path attribute value {:keys [nofollow-links]})

set-creation-timeclj

(set-creation-time path time)
(set-creation-time path time {:keys [nofollow-links]})

Set the creation time of a file or directory.

Set the creation time of a file or directory.
raw docstring

set-groupclj

(set-group path group-name)
(set-group path group-name {:keys [nofollow-links]})

set-last-access-timeclj

(set-last-access-time path time)
(set-last-access-time path time {:keys [nofollow-links]})

Set the last access time of a file or directory.

Set the last access time of a file or directory.
raw docstring

set-last-modified-timeclj

(set-last-modified-time path time)
(set-last-modified-time path time {:keys [nofollow-links]})

Set the last modified time of a file or directory.

Set the last modified time of a file or directory.
raw docstring

set-ownerclj

(set-owner path user-name)
(set-owner path user-name {:keys [nofollow-links]})

set-posix-file-permissionsclj

(set-posix-file-permissions path permissions)
(set-posix-file-permissions path permissions {:keys [nofollow-links]})

sizeclj

(size path)

slurp-file-from-archiveclj

(slurp-file-from-archive archive-path & path-components)

Read the entire contents of a file from a archive (such as a JAR).

Read the entire contents of a file from a archive (such as a JAR).
raw docstring

splitclj

(split path)

Split path to components.

Split `path` to components.
raw docstring

split-extclj

(split-ext path)

Returns a vector of [name extension].

Returns a vector of `[name extension]`.
raw docstring

split-pathclj

(split-path path)

supported-file-attribute-viewsclj

(supported-file-attribute-views path)

symlink?clj

(symlink? path)

temp-dirclj

(temp-dir prefix)
(temp-dir prefix suffix)
(temp-dir prefix suffix tries)

Create a temporary directory. Returns nil if dir could not be created even after n tries (default 10).

Create a temporary directory. Returns nil if dir could not be created
even after n tries (default 10).
raw docstring

temp-fileclj

(temp-file prefix)
(temp-file prefix suffix)
(temp-file prefix suffix tries)

Create a temporary file. Returns nil if file could not be created even after n tries (default 10).

Create a temporary file. Returns nil if file could not be created
even after n tries (default 10).
raw docstring

temp-nameclj

(temp-name prefix)
(temp-name prefix suffix)

Create a temporary file name like what is created for temp-file and temp-dir.

Create a temporary file name like what is created for [[temp-file]]
and [[temp-dir]].
raw docstring

tmpdirclj

(tmpdir)

The temporary file directory looked up via the java.io.tmpdir system property. Does not create a temporary directory.

The temporary file directory looked up via the `java.io.tmpdir`
system property. Does not create a temporary directory.
raw docstring

touchclj

(touch path & [time])

Set file modification time (default to now). Returns path.

Set file modification time (default to now). Returns `path`.
raw docstring

unix-rootclj

The root of a unix system is /, nil on Windows

The root of a unix system is `/`, `nil` on Windows
raw docstring

unzip-fileclj

(unzip-file zip-file to-dir)

varargscljmacro

(varargs klass)
(varargs klass xs)

Make a properly-tagged Java interop varargs argument. This is basically the same as into-array but properly tags the result. (u/varargs String) (u/varargs String ["A" "B"])

Make a properly-tagged Java interop varargs argument. This is basically the same as `into-array` but properly tags
the result.
  (u/varargs String)
  (u/varargs String ["A" "B"])
raw docstring

walkclj

(walk func path)

Lazily walk depth-first over the directory structure starting at path calling func with three arguments [root dirs files]. Returns a sequence of the results.

Lazily walk depth-first over the directory structure starting at
`path` calling `func` with three arguments `[root dirs files]`.
Returns a sequence of the results.
raw docstring

whichclj

(which bin-name)

with-cwdcljmacro

(with-cwd cwd & body)

Execute body with a changed working directory.

Execute `body` with a changed working directory.
raw docstring

with-mutable-cwdcljmacro

(with-mutable-cwd & body)

Execute the body in a binding with *cwd* bound to *cwd*. This allows you to change *cwd* with set!.

Execute the `body` in a binding with `*cwd*` bound to `*cwd*`.
This allows you to change `*cwd*` with `set!`.
raw docstring

with-open-path-to-resourcecljmacro

(with-open-path-to-resource [path-binding resource-filename-str] & body)

Execute body with an Path to a resource file or directory (i.e. a file in the project resources/ directory, or inside the uberjar), cleaning up when finished. Throws a FileNotFoundException if the resource does not exist; be sure to check with io/resource or similar before calling this. (with-open-path-to-resouce [path "modules"] ...)

Execute `body` with an Path to a resource file or directory (i.e. a file in the project `resources/` directory, or
inside the uberjar), cleaning up when finished.
Throws a FileNotFoundException if the resource does not exist; be sure to check with `io/resource` or similar before
calling this.
  (with-open-path-to-resouce [path "modules"]
     ...)
raw docstring

with-temp-directorycljmacro

(with-temp-directory [path-sym] & body)

with-temp-directory*clj

(with-temp-directory* f)

with-temp-filecljmacro

(with-temp-file [dir-sym path-sym] & body)

with-temp-file*clj

(with-temp-file* f)

without-extensionclj

(without-extension path)

writable?clj

(writable? path)

zip-filesclj

(zip-files from-files to-filepath)

Make a zip file with the from-files.

Make a zip file with the from-files.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close