Check that file exists: Difference between revisions

m
m (Improved grammar in comments.)
Line 1,377:
=={{header|Forth}}==
 
<syntaxhighlight lang="forth">: .exists ( str len -- ) 2dup file-status nip 0= if ." exists" else ." does not exist" then type ;
2dup file-status nip 0= if
s" input.txt" .exists
s" /input .txt" .exists: "
else
s" docs" .exists
." does not exist: "
s" /docs" .exists</syntaxhighlight>
then
type
;
 
s" input.txt" .exists cr
s" /input.txt" .exists cr
s" docs" .exists cr
s" /docs" .exists cr
s" /docs" .exists</syntaxhighlight>
 
=={{header|Fortran}}==
{{works with|Fortran|90 and later}}
5

edits