Merge branch 'master' of git://factorcode.org/git/factor
commit
df19138327
|
@ -97,10 +97,10 @@ M: unix copy-file ( from to -- )
|
|||
\ file-info boa ;
|
||||
|
||||
M: unix file-info ( path -- info )
|
||||
normalize-path stat* stat>file-info ;
|
||||
normalize-path file-status stat>file-info ;
|
||||
|
||||
M: unix link-info ( path -- info )
|
||||
normalize-path lstat* stat>file-info ;
|
||||
normalize-path link-status stat>file-info ;
|
||||
|
||||
M: unix make-link ( path1 path2 -- )
|
||||
normalize-path symlink io-error ;
|
||||
|
|
|
@ -23,7 +23,7 @@ TUPLE: linux-monitor < monitor wd inotify watches ;
|
|||
: wd>monitor ( wd -- monitor ) watches get at ;
|
||||
|
||||
: <inotify> ( -- port/f )
|
||||
inotify_init dup 0 < [ drop f ] [ <reader> ] if ;
|
||||
inotify_init dup 0 < [ drop f ] [ <input-port> ] if ;
|
||||
|
||||
: inotify-fd inotify get handle>> ;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
USING: kernel system combinators alien.syntax alien.c-types
|
||||
math io.unix.backend vocabs.loader ;
|
||||
math io.unix.backend vocabs.loader unix ;
|
||||
|
||||
IN: unix.stat
|
||||
|
||||
|
@ -60,14 +60,12 @@ FUNCTION: int mkdir ( char* path, mode_t mode ) ;
|
|||
>>
|
||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
: check-status ( n -- ) io-error ;
|
||||
: file-status ( pathname -- stat )
|
||||
"stat" <c-object> dup >r
|
||||
[ stat ] unix-system-call drop
|
||||
r> ;
|
||||
|
||||
: stat* ( pathname -- stat )
|
||||
"stat" <c-object> dup >r
|
||||
stat check-status
|
||||
r> ;
|
||||
|
||||
: lstat* ( pathname -- stat )
|
||||
"stat" <c-object> dup >r
|
||||
lstat check-status
|
||||
r> ;
|
||||
: link-status ( pathname -- stat )
|
||||
"stat" <c-object> dup >r
|
||||
[ lstat ] unix-system-call drop
|
||||
r> ;
|
||||
|
|
Loading…
Reference in New Issue