Check that file exists: Difference between revisions

m
m (Category:Simple, {{out}})
Line 1:
{{task|File System Operations}} [[Category:Simple]]
 
In this task, the job is to verify that a file called "input.txt" and the directory called "docs" exist. This should be done twice: once for the current working directory and once for a file and a directory in the filesystem root.
This should be done twice: once for the current working directory and once for a file and a directory in the filesystem root.
 
=={{header|Ada}}==
Line 765 ⟶ 766:
<lang logo>setprefix "/
show file? "input.txt</lang>
 
=={{header|Lua}}==
For directories, the following only works on platforms on which directories can be opened for reading like files.
Line 1,057 ⟶ 1,059:
Label: Put Skip List('File '!!xxx!!' not found');
End;</lang>
{{out}}
Output:
<pre>
First line of file D:\_l\tst.txt: Test line 1
Line 1,355 ⟶ 1,357:
ENDIF
</lang>
{{out}}
Output:
<pre>
input.txt exists
Anonymous user