Random utils, filesystem utilities.
Random utils, filesystem utilities.
(abs-pathname path)Returns an absolute pathname string. Relative paths are prefixed with the user's home directory.
Returns an absolute pathname string. Relative paths are prefixed with the user's home directory.
(absolute-path? pathname)Returns true if pathname represents an absolute path.
Returns `true` if `pathname` represents an absolute path.
(basename f)Returns the filename component (without directory) of f.
Returns the filename component (without directory) of `f`.
Single-element String array used as varargs placeholder for Paths/get.
Single-element String array used as varargs placeholder for `Paths/get`.
(exists? filename)Returns true if the file exists.
Returns true if the file exists.
(extension f)Returns the file extension (without the dot) of f, or nil if none.
Returns the file extension (without the dot) of `f`, or `nil` if none.
(file fname)Coerces fname to a java.io.File. Returns nil when fname is nil.
Coerces `fname` to a `java.io.File`. Returns `nil` when `fname` is `nil`.
(get-java-classpath-folders)Lists all directories the exist in Java classpath as a sequence of strings. Returns nil if there are none.
Lists all directories the exist in Java classpath as a sequence of strings. Returns nil if there are none.
(get-java-property s)Returns the value of the Java system property named s, or nil.
Returns the value of the Java system property named `s`, or `nil`.
(home-dir-pathname)(home-dir-pathname & paths)For the given pathnames creates a pathname expressed as a string by prefixing them
with user's home directory obtained from the Java property user.dir with all parts
joined using current path name separator.
For the given pathnames creates a pathname expressed as a string by prefixing them with user's home directory obtained from the Java property `user.dir` with all parts joined using current path name separator.
(mapv-java-properties v)Applies parse-java-properties to each element of vector v, returning a new
vector. Returns v unchanged when it is falsy.
Applies `parse-java-properties` to each element of vector `v`, returning a new vector. Returns `v` unchanged when it is falsy.
(parse-java-properties s)Replaces all ${property.name} placeholders in string s with their Java system
property values.
Replaces all `${property.name}` placeholders in string `s` with their Java system
property values.(parse-java-property s)Resolves a single ${...} placeholder string to its Java system property value.
Resolves a single `${...}` placeholder string to its Java system property value.
(prop-pathname prop)(prop-pathname prop paths)For the given Java property name and optional path names creates a path name expressed as a string by prefixing them with the directory obtained from a property with all parts joined using pathname separator.
For the given Java property name and optional path names creates a path name expressed as a string by prefixing them with the directory obtained from a property with all parts joined using pathname separator.
Regex matching ${property.name} placeholders in strings.
Regex matching `${property.name}` placeholders in strings.
(read-lines filename)(read-lines n filename)Read first n lines from a file. If the pathname is relative it will be relative to user's home directory.
Read first n lines from a file. If the pathname is relative it will be relative to user's home directory.
(read-preferences filename)Reads the given preferences file. If the path is relative it will be relative to user's home directory.
Reads the given preferences file. If the path is relative it will be relative to user's home directory.
Returns true if pathname represents a relative path.
Returns `true` if `pathname` represents a relative path.
(resource-exists? r)Returns true if a classpath resource named r exists.
Returns `true` if a classpath resource named `r` exists.
(resource-file resource)Returns a java.io.File object for the existing resource of the given name.
Returns a java.io.File object for the existing resource of the given name.
(resource-pathname)(resource-pathname & paths)For the given pathnames creates a pathname expressed as a string which resides within one of the Java resource directories. The path must exist to be returned.
For the given pathnames creates a pathname expressed as a string which resides within one of the Java resource directories. The path must exist to be returned.
(user-dir-pathname)(user-dir-pathname & paths)For the given pathnames creates a pathname expressed as a string by prefixing them
with user's directory (typically a project directory) obtained from the Java
property user.dir with all parts joined using current path name separator.
For the given pathnames creates a pathname expressed as a string by prefixing them with user's directory (typically a project directory) obtained from the Java property `user.dir` with all parts joined using current path name separator.
(with-ns-loading k)(with-ns-loading op k & more)Executes the given function op and passes it a key or a sequence given as k and additional, optional arguments. Before that happens it will get all identifiers from the sequence (or check if the given single k is an identifier) and try to load their namespaces if the identifier(s) is/are fully qualified.
Executes the given function op and passes it a key or a sequence given as k and additional, optional arguments. Before that happens it will get all identifiers from the sequence (or check if the given single k is an identifier) and try to load their namespaces if the identifier(s) is/are fully qualified.
(write-preferences filename data)Writes the given preference file. If the path is relative it will be relative to user's home directory.
Writes the given preference file. If the path is relative it will be relative to user's home directory.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |