diff --git a/basis/io/unix/files/files.factor b/basis/io/unix/files/files.factor index f0dc028d74..6ddb74f4a3 100644 --- a/basis/io/unix/files/files.factor +++ b/basis/io/unix/files/files.factor @@ -103,9 +103,9 @@ M: unix stat>file-info ( stat -- file-info ) [ 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 ] @@ -130,9 +130,9 @@ M: unix stat>type ( stat -- type ) ! 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 diff --git a/basis/io/unix/files/freebsd/freebsd.factor b/basis/io/unix/files/freebsd/freebsd.factor deleted file mode 100644 index 26cfe48bb1..0000000000 --- a/basis/io/unix/files/freebsd/freebsd.factor +++ /dev/null @@ -1,17 +0,0 @@ -! 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 ; diff --git a/basis/io/unix/files/freebsd/tags.txt b/basis/io/unix/files/freebsd/tags.txt deleted file mode 100644 index 6bf68304bb..0000000000 --- a/basis/io/unix/files/freebsd/tags.txt +++ /dev/null @@ -1 +0,0 @@ -unportable diff --git a/basis/io/unix/files/macosx/macosx.factor b/basis/io/unix/files/macosx/macosx.factor deleted file mode 100644 index 4173123e45..0000000000 --- a/basis/io/unix/files/macosx/macosx.factor +++ /dev/null @@ -1,16 +0,0 @@ -! 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 ; diff --git a/basis/io/unix/files/macosx/tags.txt b/basis/io/unix/files/macosx/tags.txt deleted file mode 100644 index 6bf68304bb..0000000000 --- a/basis/io/unix/files/macosx/tags.txt +++ /dev/null @@ -1 +0,0 @@ -unportable diff --git a/basis/io/unix/files/netbsd/netbsd.factor b/basis/io/unix/files/netbsd/netbsd.factor deleted file mode 100644 index c5f52cc100..0000000000 --- a/basis/io/unix/files/netbsd/netbsd.factor +++ /dev/null @@ -1,17 +0,0 @@ -! 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 ; diff --git a/basis/io/unix/files/netbsd/tags.txt b/basis/io/unix/files/netbsd/tags.txt deleted file mode 100644 index 6bf68304bb..0000000000 --- a/basis/io/unix/files/netbsd/tags.txt +++ /dev/null @@ -1 +0,0 @@ -unportable diff --git a/basis/io/unix/files/openbsd/openbsd.factor b/basis/io/unix/files/openbsd/openbsd.factor deleted file mode 100644 index 58833e7c97..0000000000 --- a/basis/io/unix/files/openbsd/openbsd.factor +++ /dev/null @@ -1,17 +0,0 @@ -! 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 ; diff --git a/basis/io/unix/files/openbsd/tags.txt b/basis/io/unix/files/openbsd/tags.txt deleted file mode 100644 index 6bf68304bb..0000000000 --- a/basis/io/unix/files/openbsd/tags.txt +++ /dev/null @@ -1 +0,0 @@ -unportable diff --git a/basis/unix/stat/freebsd/32/32.factor b/basis/unix/stat/freebsd/32/32.factor index a81fc4f02e..3692dea0c0 100644 --- a/basis/unix/stat/freebsd/32/32.factor +++ b/basis/unix/stat/freebsd/32/32.factor @@ -12,9 +12,9 @@ C-STRUCT: stat { "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" } @@ -27,4 +27,4 @@ C-STRUCT: stat { "__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 ) ; diff --git a/basis/unix/stat/freebsd/64/64.factor b/basis/unix/stat/freebsd/64/64.factor index 75d51cd6ae..73ba676701 100644 --- a/basis/unix/stat/freebsd/64/64.factor +++ b/basis/unix/stat/freebsd/64/64.factor @@ -12,9 +12,9 @@ C-STRUCT: stat { "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" } diff --git a/basis/unix/stat/linux/32/32.factor b/basis/unix/stat/linux/32/32.factor index ed53fab86b..3f6c6ba0e0 100644 --- a/basis/unix/stat/linux/32/32.factor +++ b/basis/unix/stat/linux/32/32.factor @@ -18,9 +18,9 @@ C-STRUCT: stat { "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" } ; @@ -30,4 +30,4 @@ FUNCTION: int __xstat ( int ver, char* pathname, stat* buf ) ; 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 ; diff --git a/basis/unix/stat/linux/64/64.factor b/basis/unix/stat/linux/64/64.factor index a374551385..088ab8d339 100644 --- a/basis/unix/stat/linux/64/64.factor +++ b/basis/unix/stat/linux/64/64.factor @@ -17,9 +17,9 @@ C-STRUCT: stat { "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" } ; diff --git a/basis/unix/stat/macosx/macosx.factor b/basis/unix/stat/macosx/macosx.factor index 4d84e38399..65e02b7986 100644 --- a/basis/unix/stat/macosx/macosx.factor +++ b/basis/unix/stat/macosx/macosx.factor @@ -1,21 +1,21 @@ - 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" } @@ -25,9 +25,8 @@ C-STRUCT: stat { "__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 ; diff --git a/basis/unix/stat/netbsd/32/32.factor b/basis/unix/stat/netbsd/32/32.factor index 55f5108c70..d6a60ba5c8 100644 --- a/basis/unix/stat/netbsd/32/32.factor +++ b/basis/unix/stat/netbsd/32/32.factor @@ -11,10 +11,10 @@ C-STRUCT: stat { "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" } diff --git a/basis/unix/stat/netbsd/64/64.factor b/basis/unix/stat/netbsd/64/64.factor index 163695b524..1a1f97507c 100644 --- a/basis/unix/stat/netbsd/64/64.factor +++ b/basis/unix/stat/netbsd/64/64.factor @@ -11,16 +11,16 @@ C-STRUCT: stat { "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 ) ; diff --git a/basis/unix/stat/openbsd/openbsd.factor b/basis/unix/stat/openbsd/openbsd.factor index decfb0dbb1..f76d4c6e18 100644 --- a/basis/unix/stat/openbsd/openbsd.factor +++ b/basis/unix/stat/openbsd/openbsd.factor @@ -12,16 +12,16 @@ C-STRUCT: stat { "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 ) ;