Merge branch 'master' of git://factorcode.org/git/factor

db4
Slava Pestov 2008-05-13 14:41:34 -05:00
commit 1342d0964c
2 changed files with 11 additions and 13 deletions

View File

@ -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 ;

View File

@ -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> ;