Skip to content

Commit

Permalink
io.directories.unix: make copy-file copy perms
Browse files Browse the repository at this point in the history
Like the docs claim it does
  • Loading branch information
jckarter committed Nov 27, 2011
1 parent 8b75193 commit d7c34b6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions basis/io/directories/unix/unix.factor
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ combinators continuations destructors fry io io.backend
io.directories io.encodings.binary
io.encodings.utf8 io.files io.pathnames io.files.types kernel
math.bitwise sequences system unix unix.stat vocabs.loader
classes.struct unix.ffi literals libc vocabs ;
classes.struct unix.ffi literals libc vocabs
io.files.info.unix ;
IN: io.directories.unix

CONSTANT: file-mode 0o0666
Expand All @@ -30,7 +31,9 @@ M: unix delete-directory ( path -- )
normalize-path [ rmdir ] unix-system-call drop ;

M: unix copy-file ( from to -- )
[ normalize-path ] bi@ call-next-method ;
[ normalize-path ] bi@
[ call-next-method ]
[ [ file-permissions ] dip swap set-file-permissions ] 2bi ;

: with-unix-directory ( path quot -- )
[ opendir dup [ (io-error) ] unless ] dip
Expand Down

0 comments on commit d7c34b6

Please sign in to comment.