Check that file exists: Difference between revisions
Content added Content deleted
(Added PL/M) |
m (→{{header|PL/M}}: Removed some unused declarations) |
||
Line 2,235: | Line 2,235: | ||
CP/M doesn't have a hierarchical file-system, so there are no folders or directories. This sample looks for INPUT.TXT on the current drive and also on the D: drive. An error will occur if there is no D: drive, so it is best not to run this if you haven't got one... :) |
CP/M doesn't have a hierarchical file-system, so there are no folders or directories. This sample looks for INPUT.TXT on the current drive and also on the D: drive. An error will occur if there is no D: drive, so it is best not to run this if you haven't got one... :) |
||
<br>Note that CP/M restricts file names to 7-bit ascii upper-case and not all non-letter, non-digit characters can be used. |
<br>Note that CP/M restricts file names to 7-bit ascii upper-case and not all non-letter, non-digit characters can be used. |
||
<br>CP/M filenames are up to 8 characters long with an optional, up to three character extension. |
|||
<lang plm>100H: |
<lang plm>100H: |
||
Line 2,294: | Line 2,295: | ||
EXISTS: PROCEDURE( FCB )BYTE; /* RETURNS TRUE IF THE FILE NAMED IN THE */ |
EXISTS: PROCEDURE( FCB )BYTE; /* RETURNS TRUE IF THE FILE NAMED IN THE */ |
||
DECLARE FCB ADDRESS; /* FCB EXISTS */ |
DECLARE FCB ADDRESS; /* FCB EXISTS */ |
||
DECLARE F BASED FCB BYTE, FOUND BYTE; |
|||
RETURN ( SEARCH$FIRST( FCB ) < 4 ); |
RETURN ( SEARCH$FIRST( FCB ) < 4 ); |
||
END EXISTS ; |
END EXISTS ; |