io.randomseed.bankster.util.fs
added in 1.0.0
Support functions and macros, filesystem operations.
get-java-classpath-folders
(get-java-classpath-folders)Lists all directories which exist in Java classpath as a sequence of strings. Returns nil if there are none.
get-resource
added in 1.2.4
(get-resource pname)For the given pathname, returns the resource URL if the path exists. If the path does not exist, returns nil.
home-dir-pathname
(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.home with all parts joined using current path name separator.
paths->resource
added in 1.0.0
(paths->resource)(paths->resource & paths)For the given pathnames creates a resource object that resides within one of the Java resource directories. The resource must exist for the URI to be returned.
prop-pathname
(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.
read-csv
(read-csv resource)(read-csv resource comments?)Reads CSV file and returns a sequence of rows.
When comments? is truthy: - lines beginning with # are ignored (full-line comments) - inline comments (# within a line) are preserved as part of the last column’s value
read-preferences
(read-preferences filename)(read-preferences filename opts)Reads the given preference file. If the path is relative it will be relative to user’s home directory. Optional options map will be passed to EDN reader.
resource-pathname
(resource-pathname)(resource-pathname & paths)For the given pathnames creates a pathname expressed as a string that resides within one of the Java resource directories. The path must exist to be returned. WARNING: it will only work for resources on a filesystem, giving you the regular pathname, not a URI.
rtrim-comments
added in 2.0.0
(rtrim-comments s)Removes trailing comments from a string.
Trims whitespace and content after the first hash (#) character.
user-dir-pathname
(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.