Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,23 @@
|
|||
#
|
||||
# piped.icn, Get system command output
|
||||
#
|
||||
# Dedicated to the public domain
|
||||
#
|
||||
procedure main()
|
||||
# start with an empty list
|
||||
directory := []
|
||||
|
||||
# ls for UNIX, dir for other, assume Windows
|
||||
command := if &features == "UNIX" then "ls" else "dir"
|
||||
|
||||
# open command in pipe mode
|
||||
p := open(command, "p") | stop("Cannot open pipe for ", command)
|
||||
|
||||
# read in results and append to list
|
||||
while put(directory, read(p))
|
||||
|
||||
# display the fifth entry, if there is one
|
||||
write(\directory[5])
|
||||
|
||||
close(p)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue