Merge branch 'master' of git://factorcode.org/git/factor
commit
1342d0964c
|
@ -97,10 +97,10 @@ M: unix copy-file ( from to -- )
|
||||||
\ file-info boa ;
|
\ file-info boa ;
|
||||||
|
|
||||||
M: unix file-info ( path -- info )
|
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 )
|
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 -- )
|
M: unix make-link ( path1 path2 -- )
|
||||||
normalize-path symlink io-error ;
|
normalize-path symlink io-error ;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
USING: kernel system combinators alien.syntax alien.c-types
|
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
|
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 )
|
: link-status ( pathname -- stat )
|
||||||
"stat" <c-object> dup >r
|
"stat" <c-object> dup >r
|
||||||
stat check-status
|
[ lstat ] unix-system-call drop
|
||||||
r> ;
|
r> ;
|
||||||
|
|
||||||
: lstat* ( pathname -- stat )
|
|
||||||
"stat" <c-object> dup >r
|
|
||||||
lstat check-status
|
|
||||||
r> ;
|
|
||||||
|
|
Loading…
Reference in New Issue