Check that file exists: Difference between revisions

no edit summary
m (→‎{{header|Phix}}: added personal tag)
No edit summary
Line 1,021:
'\input.txt' doesn't exist
'\docs' doesn't exist</pre>
 
=={{header|DBL}}==
<lang DBL>;
; Check file and directory exists for DBL version 4 by Dario B.
;
PROC
;------------------------------------------------------------------
XCALL FLAGS (0007000000,1) ;Suppress STOP message
 
CLOSE 1
OPEN (1,O,'TT:')
 
;The file path can be written as:
; "input.txt" (current directory)
; "/directory/input.txt" (complete path)
; "DEV:input.txt" (device DEV defined in shell)
; "$DEV/input.txt" (device DEV defined in shell)
CLOSE 2
OPEN (2,I,"input.txt") [ERR=NOFIL]
CLOSE 2
 
;Check directory (unix/linux systems)
CLOSE 2
OPEN (2,O,"/docs/.") [ERR=NODIR]
 
GOTO CLOS
 
;--------------------------------------------------------
NOFIL, DISPLAY (1,"File input.txt not found!",10)
GOTO CLOS
 
NODIR, DISPLAY (1,"Directory /docs not found!",10)
GOTO CLOS
 
CLOS, CLOSE 1
CLOSE 2
STOP</lang>
 
=={{header|DCL}}==
Anonymous user