RosettaCodeData/Task/Check-that-file-exists/Lang/check-that-file-exists.lang
2023-07-01 13:44:08 -04:00

19 lines
545 B
Text

# Load the IO module
# Replace "<pathToIO.lm>" with the location where the io.lm Lang module was installed to without "<" and ">"
ln.loadModule(<pathToIO.lm>)
$file1 = [[io]]::fp.openFile(input.txt)
[[io]]::fp.existsFile($file1)
[[io]]::fp.closeFile($file1)
$file2 = [[io]]::fp.openFile(/input.txt)
[[io]]::fp.existsFile($file2)
[[io]]::fp.closeFile($file2)
$dir1 = [[io]]::fp.openFile(docs)
[[io]]::fp.existsFile($dir1)
[[io]]::fp.closeFile($dir1)
$dir2 = [[io]]::fp.openFile(/docs)
[[io]]::fp.existsFile($dir2)
[[io]]::fp.closeFile($dir2)