Merge branch 'master' of /Users/dharmatech/builds/factor/

db4
dharmatech 2008-03-06 13:46:36 -06:00
commit c6364fe2b3
5 changed files with 45 additions and 2 deletions

View File

@ -54,6 +54,7 @@ TUPLE: no-parent-directory path ;
TUPLE: file-info type size permissions modified ;
HOOK: file-info io-backend ( path -- info )
HOOK: link-info io-backend ( path -- info )
SYMBOL: +regular-file+
SYMBOL: +directory+

View File

@ -89,3 +89,12 @@ M: unix-io file-info ( path -- info )
[ stat-st_mtim timespec-sec seconds unix-1970 time+ ]
} cleave
\ file-info construct-boa ;
M: unix-io link-info ( path -- info )
lstat* {
[ stat>type ]
[ stat-st_size ]
[ stat-st_mode ]
[ stat-st_mtim timespec-sec seconds unix-1970 time+ ]
} cleave
\ file-info construct-boa ;

View File

@ -2,7 +2,7 @@
! USING: kernel quotations namespaces sequences assocs.lib ;
USING: kernel namespaces namespaces.private quotations sequences
assocs.lib ;
assocs.lib math.parser math sequences.lib ;
IN: namespaces.lib
@ -17,3 +17,30 @@ IN: namespaces.lib
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: set* ( val var -- ) namestack* set-assoc-stack ;
SYMBOL: building-seq
: get-building-seq ( n -- seq )
building-seq get nth ;
: n, get-building-seq push ;
: n% get-building-seq push-all ;
: n# >r number>string r> n% ;
: 0, 0 n, ;
: 0% 0 n% ;
: 0# 0 n# ;
: 1, 1 n, ;
: 1% 1 n% ;
: 1# 1 n# ;
: 2, 2 n, ;
: 2% 2 n% ;
: 2# 2 n# ;
: nmake ( quot exemplars -- seqs )
dup length dup zero? [ 1+ ] when
[
[
[ drop 1024 swap new-resizable ] 2map
[ building-seq set call ] keep
] 2keep >r [ like ] 2map r> firstn
] with-scope ;

View File

@ -1,9 +1,10 @@
! Copyright (C) 2007 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel parser quotations tuples words ;
USING: kernel parser quotations prettyprint tuples words ;
IN: singleton
: SINGLETON:
CREATE-CLASS
dup { } define-tuple-class
dup unparse create-in reset-generic
dup construct-empty 1quotation define ; parsing

View File

@ -74,3 +74,8 @@ FUNCTION: int mkdir ( char* path, mode_t mode ) ;
"stat" <c-object> dup >r
stat check-status
r> ;
: lstat* ( pathname -- stat )
"stat" <c-object> dup >r
lstat check-status
r> ;