Macaulay2 » Documentation
Packages » Macaulay2Doc :: openIn(String)
next | previous | forward | backward | up | index | toc

openIn(String) -- open an input file

Synopsis

Description

i1 : "test-file" << "hi there" << close;
i2 : g = openIn "test-file"

o2 = test-file

o2 : File
i3 : fileLength g

o3 = 8
i4 : atEndOfFile g

o4 = false
i5 : read g

o5 = hi there
i6 : atEndOfFile g

o6 = true
i7 : close g

o7 = test-file

o7 : File
i8 : removeFile "test-file"

A filename starting with ~/ will have the tilde replaced by the user's home directory.

See also

Ways to use this method: