-
-
Save rebolek/23ece25ced5701c98359f5051f2b2033 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red[] | |
parse-ll: func [dir][ | |
out: copy [] | |
fileinfo!: context [ | |
name: none | |
size: none | |
date: none | |
type: none | |
] | |
call/wait/output rejoin ["ls -la " dir] out: copy {} | |
dir-files: split out newline | |
foreach file dir-files [ | |
data: split file space | |
fileinfo: make fileinfo! [ | |
type: switch first first data [#"-" ['file] #"d" ['directory] #"l" ['link]] | |
name: data/9 | |
] | |
if fileinfo/type = 'file [fileinfo/size: data/5] | |
append out fileinfo | |
] | |
out | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment