]> gitweb.factorcode.org Git - factor.git/commitdiff
found stat64 for macosx, so there's a unix-file-info and a bsd-file-info only
authorDoug Coleman <doug.coleman@gmail.com>
Tue, 7 Oct 2008 03:51:06 +0000 (22:51 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Tue, 7 Oct 2008 03:51:06 +0000 (22:51 -0500)
17 files changed:
basis/io/unix/files/files.factor
basis/io/unix/files/freebsd/freebsd.factor [deleted file]
basis/io/unix/files/freebsd/tags.txt [deleted file]
basis/io/unix/files/macosx/macosx.factor [deleted file]
basis/io/unix/files/macosx/tags.txt [deleted file]
basis/io/unix/files/netbsd/netbsd.factor [deleted file]
basis/io/unix/files/netbsd/tags.txt [deleted file]
basis/io/unix/files/openbsd/openbsd.factor [deleted file]
basis/io/unix/files/openbsd/tags.txt [deleted file]
basis/unix/stat/freebsd/32/32.factor
basis/unix/stat/freebsd/64/64.factor
basis/unix/stat/linux/32/32.factor
basis/unix/stat/linux/64/64.factor
basis/unix/stat/macosx/macosx.factor
basis/unix/stat/netbsd/32/32.factor
basis/unix/stat/netbsd/64/64.factor
basis/unix/stat/openbsd/openbsd.factor

index f0dc028d742efac6b6b428d2b312505aa7c0e6dc..6ddb74f4a3f4ff29d146f20444fdc02b413b75e5 100644 (file)
@@ -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 (file)
index 26cfe48..0000000
+++ /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 (file)
index 6bf6830..0000000
+++ /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 (file)
index 4173123..0000000
+++ /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 (file)
index 6bf6830..0000000
+++ /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 (file)
index c5f52cc..0000000
+++ /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 (file)
index 6bf6830..0000000
+++ /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 (file)
index 58833e7..0000000
+++ /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 (file)
index 6bf6830..0000000
+++ /dev/null
@@ -1 +0,0 @@
-unportable
index a81fc4f02e37776b2f16b4b48445f327ab81ad73..3692dea0c026fb5e79cf1a34b13c92a8c6e67042 100644 (file)
@@ -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 ) ;
index 75d51cd6ae50c2933db38eb9a2a074b955e42748..73ba67670119afe22970e16924affa25373eef88 100644 (file)
@@ -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" }
index ed53fab86b23976736beeeb6fae28342fed175e5..3f6c6ba0e02faff2a446f696e30ae4afbe205937 100644 (file)
@@ -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 ;
index a374551385f025a0ccc1c7e350a4a8e4637cb837..088ab8d33938f42695409f089692d545bc193f41 100644 (file)
@@ -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" } ;
index 4d84e3839950ed9cefff75bec4a87e5a2647e365..65e02b7986447624a108fc43adf6c34a3b9d42fe 100644 (file)
@@ -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 ;
index 55f5108c7013e98a68adaa2ab57f2e10f1300955..d6a60ba5c88f385b773096fb87a8be8f40001526 100644 (file)
@@ -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" }
index 163695b5246a393805b850605a15e66147580a40..1a1f97507c9a9fd6f2560b192afcb22505610c7a 100644 (file)
@@ -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 ) ;
index decfb0dbb1653633948f88a9205e00bcfe9a7ff9..f76d4c6e18e2331fa50b19e62bd4fa674bbbaf8b 100644 (file)
@@ -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 ) ;