Skip to content

razum2um/tempfile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tempfile

Build Status

Clojars Project

Provides a natural way to handle temponary files and directories in Clojure. For more info see clojure-cookbook

with-tempfile can be useful for packaging .dll or .dylib into jar, because JNA can read them only from filesystem.

Usage

;; (:require [tempfile.core :refer [tempdir tempfile with-tempfile])
(def text "some string")

;; writes stringified args to tempfile and returns java.io.File
(tempfile "some" text)

;; creates tempdir and returns java.io.File
(tempdir)

;; uses a tempfile for some scope and
;; deletes it immediately afterwards
(with-tempfile [t (tempfile text)]  ;; with a tempfile
  (pprint (.exists t)))             ;; "true"

(with-tempfile [t (tempdir)]        ;; now with a temponary directory
  (pprint (.exists t)))             ;; "true"

License

Copyright © 2014 Vlad Bokov

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

Provides a natural way to handle temponary files in Clojure

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published