[ stat>type >>type ]
[ stat-st_size >>size ]
[ stat-st_mode >>permissions ]
- [ stat-st_ctim timespec>unix-time >>created ]
- [ stat-st_mtim timespec>unix-time >>modified ]
- [ stat-st_atim timespec>unix-time >>accessed ]
+ [ stat-st_ctimespec timespec>unix-time >>created ]
+ [ stat-st_mtimespec timespec>unix-time >>modified ]
+ [ stat-st_atimespec timespec>unix-time >>accessed ]
[ stat-st_uid >>uid ]
[ stat-st_gid >>gid ]
[ stat-st_dev >>dev ]
! Linux has no extra fields in its stat struct
os {
- { macosx [ "io.unix.files.macosx" require ] }
- { freebsd [ "io.unix.files.freebsd" require ] }
- { netbsd [ "io.unix.files.netbsd" require ] }
- { openbsd [ "io.unix.files.openbsd" require ] }
+ { macosx [ "io.unix.files.bsd" require ] }
+ { netbsd [ "io.unix.files.bsd" require ] }
+ { openbsd [ "io.unix.files.bsd" require ] }
+ { freebsd [ "io.unix.files.bsd" require ] }
{ linux [ ] }
} case
+++ /dev/null
-! Copyright (C) 2008 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: kernel alien.syntax math io.unix.files system
-unix.stat accessors combinators calendar.unix ;
-IN: io.unix.files.freebsd
-
-TUPLE: freebsd-file-info < unix-file-info birth-time flags gen ;
-
-M: freebsd new-file-info ( -- class ) freebsd-file-info new ;
-
-M: freebsd stat>file-info ( stat -- file-info )
- [ call-next-method ] keep
- {
- [ stat-st_flags >>flags ]
- [ stat-st_gen >>gen ]
- [ stat-st_birthtimespec timespec>unix-time >>birth-time ]
- } cleave ;
+++ /dev/null
-unportable
+++ /dev/null
-! Copyright (C) 2008 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: kernel alien.syntax math io.unix.files system
-unix.stat accessors combinators ;
-IN: io.unix.files.macosx
-
-TUPLE: macosx-file-info < unix-file-info flags gen ;
-
-M: macosx new-file-info ( -- class ) macosx-file-info new ;
-
-M: macosx stat>file-info ( stat -- file-info )
- [ call-next-method ] keep
- {
- [ stat-st_flags >>flags ]
- [ stat-st_gen >>gen ]
- } cleave ;
+++ /dev/null
-unportable
+++ /dev/null
-! Copyright (C) 2008 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: kernel alien.syntax math io.unix.files system
-unix.stat accessors combinators calendar.unix ;
-IN: io.unix.files.netbsd
-
-TUPLE: netbsd-file-info < unix-file-info birth-time flags gen ;
-
-M: netbsd new-file-info ( -- class ) netbsd-file-info new ;
-
-M: netbsd stat>file-info ( stat -- file-info )
- [ call-next-method ] keep
- {
- [ stat-st_flags >>flags ]
- [ stat-st_gen >>gen ]
- [ stat-st_birthtim timespec>unix-time >>birth-time ]
- } cleave ;
+++ /dev/null
-unportable
+++ /dev/null
-! Copyright (C) 2008 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: kernel alien.syntax math io.unix.files system
-unix.stat accessors combinators calendar.unix ;
-IN: io.unix.files.openbsd
-
-TUPLE: openbsd-file-info < unix-file-info birth-time flags gen ;
-
-M: openbsd new-file-info ( -- class ) openbsd-file-info new ;
-
-M: openbsd stat>file-info ( stat -- file-info )
- [ call-next-method ] keep
- {
- [ stat-st_flags >>flags ]
- [ stat-st_gen >>gen ]
- [ stat-st_birthtim timespec>unix-time >>birth-time ]
- } cleave ;
+++ /dev/null
-unportable
{ "uid_t" "st_uid" }
{ "gid_t" "st_gid" }
{ "__dev_t" "st_rdev" }
- { "timespec" "st_atim" }
- { "timespec" "st_mtim" }
- { "timespec" "st_ctim" }
+ { "timespec" "st_atimespec" }
+ { "timespec" "st_mtimespec" }
+ { "timespec" "st_ctimespec" }
{ "off_t" "st_size" }
{ "blkcnt_t" "st_blocks" }
{ "blksize_t" "st_blksize" }
{ "__uint32_t" "pad1" } ;
FUNCTION: int stat ( char* pathname, stat* buf ) ;
-FUNCTION: int lstat ( char* pathname, stat* buf ) ;
\ No newline at end of file
+FUNCTION: int lstat ( char* pathname, stat* buf ) ;
{ "uid_t" "st_uid" }
{ "gid_t" "st_gid" }
{ "__dev_t" "st_rdev" }
- { "timespec" "st_atim" }
- { "timespec" "st_mtim" }
- { "timespec" "st_ctim" }
+ { "timespec" "st_atimespec" }
+ { "timespec" "st_mtimespec" }
+ { "timespec" "st_ctimespec" }
{ "off_t" "st_size" }
{ "blkcnt_t" "st_blocks" }
{ "blksize_t" "st_blksize" }
{ "off_t" "st_size" }
{ "blksize_t" "st_blksize" }
{ "blkcnt_t" "st_blocks" }
- { "timespec" "st_atim" }
- { "timespec" "st_mtim" }
- { "timespec" "st_ctim" }
+ { "timespec" "st_atimespec" }
+ { "timespec" "st_mtimespec" }
+ { "timespec" "st_ctimespec" }
{ "ulong" "unused4" }
{ "ulong" "unused5" } ;
FUNCTION: int __lxstat ( int ver, char* pathname, stat* buf ) ;
: stat ( pathname buf -- int ) 3 -rot __xstat ;
-: lstat ( pathname buf -- int ) 3 -rot __lxstat ;
\ No newline at end of file
+: lstat ( pathname buf -- int ) 3 -rot __lxstat ;
{ "off_t" "st_size" }
{ "blksize_t" "st_blksize" }
{ "blkcnt_t" "st_blocks" }
- { "timespec" "st_atim" }
- { "timespec" "st_mtim" }
- { "timespec" "st_ctim" }
+ { "timespec" "st_atimespec" }
+ { "timespec" "st_mtimespec" }
+ { "timespec" "st_ctimespec" }
{ "long" "__unused0" }
{ "long" "__unused1" }
{ "long" "__unused2" } ;
-
USING: kernel alien.syntax math ;
-
IN: unix.stat
! Mac OS X ppc
+! stat64 structure
C-STRUCT: stat
{ "dev_t" "st_dev" }
- { "ino_t" "st_ino" }
{ "mode_t" "st_mode" }
{ "nlink_t" "st_nlink" }
+ { "ino_t" "st_ino" }
{ "uid_t" "st_uid" }
{ "gid_t" "st_gid" }
{ "dev_t" "st_rdev" }
{ "timespec" "st_atimespec" }
{ "timespec" "st_mtimespec" }
{ "timespec" "st_ctimespec" }
+ { "timespec" "st_birthtimespec" }
{ "off_t" "st_size" }
{ "blkcnt_t" "st_blocks" }
{ "blksize_t" "st_blksize" }
{ "__int64_t" "st_qspare0" }
{ "__int64_t" "st_qspare1" } ;
-FUNCTION: int stat ( char* pathname, stat* buf ) ;
-FUNCTION: int lstat ( char* pathname, stat* buf ) ;
+FUNCTION: int stat64 ( char* pathname, stat* buf ) ;
+FUNCTION: int lstat64 ( char* pathname, stat* buf ) ;
-: stat-st_atim ( stat -- timespec ) stat-st_atimespec ;
-: stat-st_mtim ( stat -- timespec ) stat-st_mtimespec ;
-: stat-st_ctim ( stat -- timespec ) stat-st_ctimespec ;
+: stat ( path buf -- n ) stat64 ;
+: lstat ( path buf -- n ) lstat64 ;
{ "uid_t" "st_uid" }
{ "gid_t" "st_gid" }
{ "dev_t" "st_rdev" }
- { "timespec" "st_atim" }
- { "timespec" "st_mtim" }
- { "timespec" "st_ctim" }
- { "timespec" "st_birthtim" }
+ { "timespec" "st_atimespec" }
+ { "timespec" "st_mtimespec" }
+ { "timespec" "st_ctimespec" }
+ { "timespec" "st_birthtimespec" }
{ "off_t" "st_size" }
{ "blkcnt_t" "st_blocks" }
{ "blksize_t" "st_blksize" }
{ "uid_t" "st_uid" }
{ "gid_t" "st_gid" }
{ "dev_t" "st_rdev" }
- { "timespec" "st_atim" }
- { "timespec" "st_mtim" }
- { "timespec" "st_ctim" }
+ { "timespec" "st_atimespec" }
+ { "timespec" "st_mtimespec" }
+ { "timespec" "st_ctimespec" }
{ "off_t" "st_size" }
{ "blkcnt_t" "st_blocks" }
{ "blksize_t" "st_blksize" }
{ "uint32_t" "st_flags" }
{ "uint32_t" "st_gen" }
{ "uint32_t" "st_spare0" }
- { "timespec" "st_birthtim" } ;
+ { "timespec" "st_birthtimespec" } ;
FUNCTION: int __stat13 ( char* pathname, stat* buf ) ;
FUNCTION: int __lstat13 ( char* pathname, stat* buf ) ;
{ "gid_t" "st_gid" }
{ "dev_t" "st_rdev" }
{ "int32_t" "st_lspare0" }
- { "timespec" "st_atim" }
- { "timespec" "st_mtim" }
- { "timespec" "st_ctim" }
+ { "timespec" "st_atimespec" }
+ { "timespec" "st_mtimespec" }
+ { "timespec" "st_ctimespec" }
{ "off_t" "st_size" }
{ "int64_t" "st_blocks" }
{ "u_int32_t" "st_blksize" }
{ "u_int32_t" "st_flags" }
{ "u_int32_t" "st_gen" }
{ "int32_t" "st_lspare1" }
- { "timespec" "st_birthtim" }
+ { "timespec" "st_birthtimespec" }
{ { "int64_t" 2 } "st_qspare" } ;
FUNCTION: int stat ( char* pathname, stat* buf ) ;