]> gitweb.factorcode.org Git - factor.git/commitdiff
io.backend: Remove duplicate definition of file-mode. Add mkdir-mode using non-magic...
authorDoug Coleman <doug.coleman@gmail.com>
Sat, 25 Oct 2014 00:16:40 +0000 (17:16 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Sat, 25 Oct 2014 00:16:40 +0000 (17:16 -0700)
basis/io/backend/unix/unix.factor
basis/io/directories/unix/unix.factor

index 4cb07d780df010d2cbb7bdbcfa8acd045545dee2..64fe90f18bf9c591c2ef3290deeb39a4be38f554 100755 (executable)
@@ -1,16 +1,16 @@
 ! Copyright (C) 2004, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien alien.c-types alien.data alien.syntax generic
-assocs kernel kernel.private math io.ports sequences strings
-sbufs threads unix unix.ffi unix.stat vectors io.buffers io.backend
-io.encodings io.files math.parser continuations system libc namespaces
-make io.timeouts io.encodings.utf8 destructors
-destructors.private accessors summary combinators locals
-unix.time unix.types fry io.backend.unix.multiplexers
-classes.struct hints ;
+USING: accessors alien.c-types alien.data alien.syntax
+classes.struct combinators destructors destructors.private fry
+hints io.backend io.backend.unix.multiplexers io.buffers
+io.files io.ports io.timeouts kernel kernel.private libc
+literals locals make math namespaces sequences summary system
+threads unix unix.ffi unix.stat unix.types ;
 QUALIFIED: io
 IN: io.backend.unix
 
+CONSTANT: file-mode 0o0666
+
 GENERIC: handle-fd ( handle -- fd )
 
 TUPLE: fd < disposable fd ;
@@ -82,7 +82,6 @@ M: unix wait-for-fd ( handle event -- )
     '[ handle>> _ wait-for-fd ] with-timeout ;
 
 ! Some general stuff
-CONSTANT: file-mode 0o0666
 
 M: fd refill
     fd>> over buffer>> [ buffer-end ] [ buffer-capacity ] bi read
index a17a8180dfc2ce3214e26c019cff506c94356e56..b401813005dab22df157bc133031163c68b9ac1d 100644 (file)
@@ -1,17 +1,16 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors alien.c-types alien.data alien.strings
-assocs combinators continuations destructors fry io io.backend
-io.directories io.encodings.binary io.files.info.unix
-io.encodings.utf8 io.files io.pathnames io.files.types kernel
-math math.bitwise sequences system unix unix.stat vocabs.loader
-classes.struct unix.ffi literals libc vocabs io.files.info ;
+USING: accessors alien.c-types alien.data alien.strings assocs
+classes.struct continuations fry io.backend io.backend.unix
+io.directories io.encodings.utf8 io.files io.files.info
+io.files.info.unix io.files.types kernel libc literals math
+sequences system unix unix.ffi vocabs ;
 IN: io.directories.unix
 
-CONSTANT: file-mode 0o0666
-
 CONSTANT: touch-mode flags{ O_WRONLY O_APPEND O_CREAT O_EXCL }
 
+CONSTANT: mkdir-mode flags{ USER-ALL GROUP-ALL OTHER-ALL } ! 0o777
+
 M: unix touch-file ( path -- )
     normalize-path
     dup exists? [ touch ] [
@@ -24,7 +23,7 @@ M: unix move-file ( from to -- )
 M: unix delete-file ( path -- ) normalize-path unlink-file ;
 
 M: unix make-directory ( path -- )
-    normalize-path 0o777 [ mkdir ] unix-system-call drop ;
+    normalize-path mkdir-mode [ mkdir ] unix-system-call drop ;
 
 M: unix delete-directory ( path -- )
     normalize-path [ rmdir ] unix-system-call drop ;