| 1 |
DEFINITION MODULE CFileSysOp ; |
| 2 |
|
| 3 |
FROM SYSTEM IMPORT ADDRESS ; |
| 4 |
|
| 5 |
|
| 6 |
(* |
| 7 |
Description: provides access to filesystem operations. |
| 8 |
The implementation module is written in C |
| 9 |
and the parameters behave as their C |
| 10 |
counterparts. |
| 11 |
*) |
| 12 |
|
| 13 |
TYPE |
| 14 |
AccessMode = SET OF AccessStatus ; |
| 15 |
AccessStatus = (F_OK, R_OK, W_OK, X_OK, A_FAIL) ; |
| 16 |
|
| 17 |
|
| 18 |
PROCEDURE Unlink (filename: ADDRESS) : INTEGER ; |
| 19 |
|
| 20 |
|
| 21 |
(* |
| 22 |
Access - test access to a path or file. The behavior is |
| 23 |
the same as defined in access(2). Except that |
| 24 |
on A_FAIL is only used during the return result |
| 25 |
indicating the underlying C access has returned |
| 26 |
-1 (and errno can be checked). |
| 27 |
*) |
| 28 |
|
| 29 |
PROCEDURE Access (pathname: ADDRESS; mode: AccessMode) : AccessMode ; |
| 30 |
|
| 31 |
|
| 32 |
(* Return TRUE if the caller can see the existance of the file or |
| 33 |
directory on the filesystem. *) |
| 34 |
|
| 35 |
(* |
| 36 |
IsDir - return true if filename is a regular directory. |
| 37 |
*) |
| 38 |
|
| 39 |
PROCEDURE IsDir (dirname: ADDRESS) : BOOLEAN ; |
| 40 |
|
| 41 |
|
| 42 |
(* |
| 43 |
IsFile - return true if filename is a regular file. |
| 44 |
*) |
| 45 |
|
| 46 |
PROCEDURE IsFile (filename: ADDRESS) : BOOLEAN ; |
| 47 |
|
| 48 |
|
| 49 |
(* |
| 50 |
Exists - return true if pathname exists. |
| 51 |
*) |
| 52 |
|
| 53 |
PROCEDURE Exists (pathname: ADDRESS) : BOOLEAN ; |
| 54 |
|
| 55 |
|
| 56 |
END CFileSysOp. |