diff --git a/extra/ls/authors.txt b/extra/ls/authors.txt deleted file mode 100644 index 7c1b2f2279..0000000000 --- a/extra/ls/authors.txt +++ /dev/null @@ -1 +0,0 @@ -Doug Coleman diff --git a/extra/ls/ls-tests.factor b/extra/ls/ls-tests.factor deleted file mode 100644 index b1c1f18472..0000000000 --- a/extra/ls/ls-tests.factor +++ /dev/null @@ -1,6 +0,0 @@ -! Copyright (C) 2008 Your name. -! See http://factorcode.org/license.txt for BSD license. -USING: tools.test ls strings kernel ; -IN: ls.tests - -[ ] [ "" ls drop ] unit-test diff --git a/extra/ls/ls.factor b/extra/ls/ls.factor deleted file mode 100755 index 92aff714e6..0000000000 --- a/extra/ls/ls.factor +++ /dev/null @@ -1,40 +0,0 @@ -! Copyright (C) 2008 Doug Coleman. -! See http://factorcode.org/license.txt for BSD license. -USING: accessors arrays combinators io io.files kernel -math.parser sequences system vocabs.loader calendar -sequences.lib ; - -IN: ls - -: ls-time ( timestamp -- string ) - [ hour>> ] [ minute>> ] bi - [ number>string 2 CHAR: 0 pad-left ] bi@ ":" splice ; - -: ls-timestamp ( timestamp -- string ) - [ month>> month-abbreviation ] - [ day>> number>string 2 CHAR: \s pad-left ] - [ - dup year>> dup now year>> = - [ drop ls-time ] [ nip number>string ] if - 5 CHAR: \s pad-left - ] tri 3array " " join ; - -: read>string ( ? -- string ) "r" "-" ? ; inline - -: write>string ( ? -- string ) "w" "-" ? ; inline - -HOOK: execute>string os ( ? -- string ) - -M: object execute>string ( ? -- string ) "x" "-" ? ; inline - -HOOK: permissions-string os ( -- str ) - -HOOK: (directory.) os ( path -- lines ) - -: directory. ( path -- ) - [ (directory.) ] with-directory-files [ print ] each ; - -{ - { [ os unix? ] [ "ls.unix" ] } - { [ os windows? ] [ "ls.windows" ] } -} cond require \ No newline at end of file diff --git a/extra/ls/tags.txt b/extra/ls/tags.txt deleted file mode 100644 index 6bf68304bb..0000000000 --- a/extra/ls/tags.txt +++ /dev/null @@ -1 +0,0 @@ -unportable diff --git a/extra/ls/unix/authors.txt b/extra/ls/unix/authors.txt deleted file mode 100755 index 7c1b2f2279..0000000000 --- a/extra/ls/unix/authors.txt +++ /dev/null @@ -1 +0,0 @@ -Doug Coleman diff --git a/extra/ls/unix/tags.txt b/extra/ls/unix/tags.txt deleted file mode 100644 index 6bf68304bb..0000000000 --- a/extra/ls/unix/tags.txt +++ /dev/null @@ -1 +0,0 @@ -unportable diff --git a/extra/ls/unix/unix.factor b/extra/ls/unix/unix.factor deleted file mode 100755 index 9a3f832961..0000000000 --- a/extra/ls/unix/unix.factor +++ /dev/null @@ -1,41 +0,0 @@ -! Copyright (C) 2008 Doug Coleman. -! See http://factorcode.org/license.txt for BSD license. -USING: accessors combinators combinators.cleave kernel system unicode.case -io.unix.files ls ; -IN: ls.unix - -M: unix execute-string ( str bools -- str' ) - swap { - { { t t } [ >lower ] } - { { t f } [ >upper ] } - { { f t } [ drop "x" ] } - [ 2drop "-" ] - } case ; - -M: unix permissions-string ( permissions -- str ) - { - [ type>> file-type>ch 1string ] - [ user-read? read>string ] - [ user-write? write>string ] - [ [ uid? ] [ user-execute? ] bi 2array "s" execute-string ] - [ group-read? read>string ] - [ group-write? write>string ] - [ [ gid? ] [ group-execute? ] bi 2array "s" execute-string ] - [ other-read? read>string ] - [ other-write? write>string ] - [ [ sticky? ] [ other-execute? ] bi 2array "t" execute-string ] - } concat ; - -M: unix ls ( path -- lines ) - [ [ - dup file-info - { - [ permissions-string ] - [ nlink>> number>string 3 CHAR: \s pad-left ] - ! [ uid>> ] - ! [ gid>> ] - [ size>> number>string 15 CHAR: \s pad-left ] - [ modified>> ls-timestamp ] - } swap suffix " " join - ] map - ] with-group-cache ] with-user-cache ; \ No newline at end of file diff --git a/extra/ls/windows/authors.txt b/extra/ls/windows/authors.txt deleted file mode 100755 index 7c1b2f2279..0000000000 --- a/extra/ls/windows/authors.txt +++ /dev/null @@ -1 +0,0 @@ -Doug Coleman diff --git a/extra/ls/windows/tags.txt b/extra/ls/windows/tags.txt deleted file mode 100644 index 6bf68304bb..0000000000 --- a/extra/ls/windows/tags.txt +++ /dev/null @@ -1 +0,0 @@ -unportable diff --git a/extra/ls/windows/windows.factor b/extra/ls/windows/windows.factor deleted file mode 100755 index b7d7eeeb0b..0000000000 --- a/extra/ls/windows/windows.factor +++ /dev/null @@ -1,20 +0,0 @@ -! Copyright (C) 2008 Doug Coleman. -! See http://factorcode.org/license.txt for BSD license. -USING: accessors calendar.format combinators combinators.cleave -io.files kernel math.parser sequences splitting system ls sequences.lib ; -IN: ls.windows - -: directory-or-size ( file-info -- str ) - dup directory? [ - drop "" 20 CHAR: \s pad-right - ] [ - size>> number>string 20 CHAR: \s pad-left - ] if ; - -M: windows (directory.) ( entries -- lines ) - [ - dup file-info { - [ modified>> timestamp>ymdhms " " split1 " " splice ] - [ directory-or-size ] - } swap suffix " " join - ] map ; \ No newline at end of file