next | previous | forward | backward | up | top | index | toc | home
Macaulay2 > The Macaulay2 language > file manipulation > fileExists

fileExists -- whether a file exists

Synopsis

Description

i1 : fn = temporaryFileName()

o1 = /tmp/M2-28048-1
i2 : fileExists fn

o2 = false
i3 : fn << "hi there" << close

o3 = /tmp/M2-28048-1

o3 : File
i4 : fileExists fn

o4 = true
i5 : removeFile fn
If fn refers to a symbolic link, then whether the file exists is determined by the content of the link and whether there is a file with the new path determined by it.