! Copyright (C) 2004, 2008 Slava Pestov, Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays combinators combinators.short-circuit
-destructors fry io io.backend io.encodings.binary io.files
-io.files.types io.pathnames kernel namespaces sequences
-system vocabs vocabs.loader ;
+USING: accessors combinators combinators.short-circuit
+continuations destructors fry io io.backend io.encodings.binary
+io.files io.pathnames kernel namespaces sequences system vocabs ;
IN: io.directories
: set-current-directory ( path -- )
HOOK: delete-directory io-backend ( path -- )
+: ?delete-file ( path -- )
+ '[ _ delete-file ] ignore-errors ;
+
: to-directory ( from to -- from to' )
over file-name append-path ;
! Copyright (C) 2009, 2010 Slava Pestov, Joe Groff.
! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays assocs io.directories io.encodings.utf8
-io.files io.pathnames kernel make math.parser memoize sequences
-sets sorting summary vocabs vocabs.loader words system
-classes.algebra combinators.short-circuit fry continuations
-namespaces ;
+USING: accessors arrays assocs classes.algebra
+combinators.short-circuit continuations io.directories
+io.encodings.utf8 io.files io.pathnames kernel make math.parser
+memoize namespaces sequences sets summary system vocabs
+vocabs.loader words ;
IN: vocabs.metadata
: check-vocab ( vocab -- vocab )
vocab-append-path dup
[ dup exists? [ utf8 file-lines ] [ drop f ] if ] when ;
-: ?delete-file ( pathname -- ) '[ _ delete-file ] ignore-errors ;
-
: set-vocab-file-contents ( seq vocab name -- )
dupd vocab-append-path [
swap [ ?delete-file ] [ swap utf8 set-file-lines ] if-empty
! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
-USING: combinators io io.files io.files.links io.directories
-io.pathnames io.streams.string kernel math math.parser
-continuations namespaces pack prettyprint sequences strings
-system tools.hexdump io.encodings.binary summary accessors
-io.backend byte-arrays io.streams.byte-array splitting ;
+USING: accessors byte-arrays combinators io io.backend
+io.directories io.encodings.binary io.files io.files.links
+io.pathnames io.streams.byte-array io.streams.string kernel
+math math.parser namespaces sequences strings summary ;
IN: tar
CONSTANT: zero-checksum 256
! FIXME: linux tar calls unlinkat and makelinkat
: make-links ( -- )
to-link get [
- [ [ name>> delete-file ] [ 2drop ] recover ] [ do-link ] bi
+ [ name>> ?delete-file ] [ do-link ] bi
] each ;
: untar ( path -- )