From 14bf7e4194dc8688e9fa7d770383c36e12a0df75 Mon Sep 17 00:00:00 2001 From: Alex Chapman Date: Wed, 12 Mar 2008 14:42:07 +1100 Subject: [PATCH] removing io.files.tmp in favour of io.files.unique --- extra/io/files/tmp/tmp-tests.factor | 5 ----- extra/io/files/tmp/tmp.factor | 22 ---------------------- 2 files changed, 27 deletions(-) delete mode 100644 extra/io/files/tmp/tmp-tests.factor delete mode 100644 extra/io/files/tmp/tmp.factor diff --git a/extra/io/files/tmp/tmp-tests.factor b/extra/io/files/tmp/tmp-tests.factor deleted file mode 100644 index ba2ff7046c..0000000000 --- a/extra/io/files/tmp/tmp-tests.factor +++ /dev/null @@ -1,5 +0,0 @@ -USING: io.files io.files.tmp kernel strings tools.test ; -IN: temporary - -[ t ] [ tmpdir string? ] unit-test -[ t f ] [ ".tmp" [ dup exists? swap ] with-tmpfile exists? ] unit-test diff --git a/extra/io/files/tmp/tmp.factor b/extra/io/files/tmp/tmp.factor deleted file mode 100644 index a859cfdc91..0000000000 --- a/extra/io/files/tmp/tmp.factor +++ /dev/null @@ -1,22 +0,0 @@ -USING: continuations io io.files kernel sequences strings.lib ; -IN: io.files.tmp - -: tmpdir ( -- dirname ) - #! ensure that a tmp dir exists and return its name - #! I'm using a sub-directory of factor for crossplatconformity (windows doesn't have /tmp) - "tmp" resource-path dup directory? [ dup make-directory ] unless ; - -: touch ( filename -- ) - dispose ; - -: tmpfile ( extension -- filename ) - 16 random-alphanumeric-string over append - tmpdir swap path+ dup exists? [ - drop tmpfile - ] [ - nip dup touch - ] if ; - -: with-tmpfile ( extension quot -- ) - #! quot should have stack effect ( filename -- ) - swap tmpfile tuck swap curry swap [ delete-file ] curry [ ] cleanup ;