diff --git a/extra/io/unix/files/files.factor b/extra/io/unix/files/files.factor index 401904faeb..835b14e66d 100755 --- a/extra/io/unix/files/files.factor +++ b/extra/io/unix/files/files.factor @@ -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 ; diff --git a/extra/io/unix/linux/monitors/monitors.factor b/extra/io/unix/linux/monitors/monitors.factor index cd17dfbbce..31dbe42e64 100644 --- a/extra/io/unix/linux/monitors/monitors.factor +++ b/extra/io/unix/linux/monitors/monitors.factor @@ -23,7 +23,7 @@ TUPLE: linux-monitor < monitor wd inotify watches ; : wd>monitor ( wd -- monitor ) watches get at ; : ( -- port/f ) - inotify_init dup 0 < [ drop f ] [ ] if ; + inotify_init dup 0 < [ drop f ] [ ] if ; : inotify-fd inotify get handle>> ; diff --git a/extra/unix/stat/stat.factor b/extra/unix/stat/stat.factor index cb1c939878..2bc60105b4 100644 --- a/extra/unix/stat/stat.factor +++ b/extra/unix/stat/stat.factor @@ -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" dup >r + [ stat ] unix-system-call drop + r> ; -: stat* ( pathname -- stat ) - "stat" dup >r - stat check-status - r> ; - -: lstat* ( pathname -- stat ) - "stat" dup >r - lstat check-status - r> ; +: link-status ( pathname -- stat ) + "stat" dup >r + [ lstat ] unix-system-call drop + r> ;