Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1 @@
Stdout printCR: ( PipeStream outputFromCommand:'ls' )

View file

@ -0,0 +1 @@
Stdout printCR:('.' asFilename directoryContents sort asStringWith:Character cr)

View file

@ -0,0 +1 @@
'.' asFilename directoryContents sort do:#printCR

View file

@ -0,0 +1,34 @@
dir := '.' asFilename.
dir directoryContentsAsFilenames sort do:[:fn |
|line|
"
generate a line of the form of ls -l:
drwxrwxrwx user group size date time name
where year is printed if not current, time of day otherwise
"
line := String streamContents:[:s |
|accessRights|
s nextPut:(fn isDirectory ifTrue:[$d] ifFalse:[$-]).
accessRights := fn symbolicAccessRights.
#( readUser writeUser executeUser
readGroup writeGroup executeGroup
readOthers writeOthers executeOthers
)
with:'rwxrwxrwx'
do:[:eachRight :charToPrint |
s nextPut:((accessRights includes:eachRight) ifTrue:[charToPrint] ifFalse:[$-])
].
(OperatingSystem getUserNameFromID:fn info uid) printOn:s leftPaddedTo:10.
(OperatingSystem getGroupNameFromID:fn info gid) printOn:s leftPaddedTo:10.
fn fileSize printOn:s leftPaddedTo:12.
fn modificationTime year = Date today year ifTrue:[
fn modificationTime printOn:s format:' %(dayPadded) %(ShortMonthName) %h:%m'.
] ifFalse:[
fn modificationTime asDate printOn:s format:' %(dayPadded) %(ShortMonthName) %y'.
].
s space.
s nextPutAll:fn baseName
].
line printCR
].