misaki.util.file documentation

File control utility

delete-file

Delete file.

extension-filter

(extension-filter ext file-list)
Filter file list with `has-extension?`.

file?

(file? x)
Check whether specified data is java.io.File or not.

find-clj-files

(find-clj-files dir)
Find *.clj files in `dir` recursively.

find-files

(find-files dir)
Find files in `dir` recursively.

get-last-extension

Get last extension from file.

(get-last-extension "foo.bar")
;=> "bar"
(get-last-extension "foo.bar.baz")
;=> "baz"

get-parent-path

(get-parent-path path)
Get parent path name(String).
If specified path has no parent, returns the path itself.

    (get-parent-path "/foo/bar")
    ;=> "/foo"
    (get-parent-path "/foo/")
    ;=> "/foo/"

has-extension?

Check whether file has specified extension or not.

last-modified-date

(last-modified-date file)
Get last modified date from java.io.File

make-directories

(make-directories filename)
Make directories which will place file.

normalize-extension

(normalize-extension ext)
Normalize file extension.

normalize-path

(normalize-path path)
Normalize file path.
If path does not contain '/' at end of string, add '/'.

path

(path & paths)
Combine paths.

remove-last-extension

Remove file extension.

(remove-last-extension "foo.bar")
;=> "foo"
(remove-last-extension "foo.bar.baz")
;=> "foo.bar"

write-file

(write-file filename data)
Write compiled data as specified filename.
If filepath is not exists, this function make directories.