next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Macaulay2Doc > The Macaulay2 language > file manipulation > readDirectory

readDirectory -- read the contents of a directory

Synopsis

Description

i1 : dir = temporaryFileName()

o1 = /tmp/M2-247950-0/0
i2 : makeDirectory dir
i3 : (fn = dir | "/" | "foo") << "hi there" << close

o3 = /tmp/M2-247950-0/0/foo

o3 : File
i4 : readDirectory dir

o4 = {.., foo, .}

o4 : List
i5 : removeFile fn
i6 : removeDirectory dir

See also

For the programmer

The object readDirectory is a compiled function.