io.backend: Remove duplicate definition of file-mode. Add mkdir-mode using non-magic symbols. Cleanup imports.

db4
Doug Coleman 2014-10-24 17:16:40 -07:00
parent 01187b378c
commit be232dac9b
2 changed files with 16 additions and 18 deletions

View File

@ -1,16 +1,16 @@
! Copyright (C) 2004, 2008 Slava Pestov. ! Copyright (C) 2004, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.c-types alien.data alien.syntax generic USING: accessors alien.c-types alien.data alien.syntax
assocs kernel kernel.private math io.ports sequences strings classes.struct combinators destructors destructors.private fry
sbufs threads unix unix.ffi unix.stat vectors io.buffers io.backend hints io.backend io.backend.unix.multiplexers io.buffers
io.encodings io.files math.parser continuations system libc namespaces io.files io.ports io.timeouts kernel kernel.private libc
make io.timeouts io.encodings.utf8 destructors literals locals make math namespaces sequences summary system
destructors.private accessors summary combinators locals threads unix unix.ffi unix.stat unix.types ;
unix.time unix.types fry io.backend.unix.multiplexers
classes.struct hints ;
QUALIFIED: io QUALIFIED: io
IN: io.backend.unix IN: io.backend.unix
CONSTANT: file-mode 0o0666
GENERIC: handle-fd ( handle -- fd ) GENERIC: handle-fd ( handle -- fd )
TUPLE: fd < disposable fd ; TUPLE: fd < disposable fd ;
@ -82,7 +82,6 @@ M: unix wait-for-fd ( handle event -- )
'[ handle>> _ wait-for-fd ] with-timeout ; '[ handle>> _ wait-for-fd ] with-timeout ;
! Some general stuff ! Some general stuff
CONSTANT: file-mode 0o0666
M: fd refill M: fd refill
fd>> over buffer>> [ buffer-end ] [ buffer-capacity ] bi read fd>> over buffer>> [ buffer-end ] [ buffer-capacity ] bi read

View File

@ -1,17 +1,16 @@
! Copyright (C) 2008 Slava Pestov. ! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien.c-types alien.data alien.strings USING: accessors alien.c-types alien.data alien.strings assocs
assocs combinators continuations destructors fry io io.backend classes.struct continuations fry io.backend io.backend.unix
io.directories io.encodings.binary io.files.info.unix io.directories io.encodings.utf8 io.files io.files.info
io.encodings.utf8 io.files io.pathnames io.files.types kernel io.files.info.unix io.files.types kernel libc literals math
math math.bitwise sequences system unix unix.stat vocabs.loader sequences system unix unix.ffi vocabs ;
classes.struct unix.ffi literals libc vocabs io.files.info ;
IN: io.directories.unix IN: io.directories.unix
CONSTANT: file-mode 0o0666
CONSTANT: touch-mode flags{ O_WRONLY O_APPEND O_CREAT O_EXCL } 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 -- ) M: unix touch-file ( path -- )
normalize-path normalize-path
dup exists? [ touch ] [ dup exists? [ touch ] [
@ -24,7 +23,7 @@ M: unix move-file ( from to -- )
M: unix delete-file ( path -- ) normalize-path unlink-file ; M: unix delete-file ( path -- ) normalize-path unlink-file ;
M: unix make-directory ( path -- ) 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 -- ) M: unix delete-directory ( path -- )
normalize-path [ rmdir ] unix-system-call drop ; normalize-path [ rmdir ] unix-system-call drop ;