-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFileSystem.def
54 lines (33 loc) · 1.32 KB
/
FileSystem.def
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
(*!m2r10*) (* Copyright (c) 2015 B.Kowarsch. All rights reserved. *)
DEFINITION MODULE FileSystem;
(* File System Access library *)
TYPE Access = ( Read, Write, Execute );
TYPE AccessFlags = SET OF Access;
TYPE Permissions = RECORD
owner, group, world : AccessFlags;
END;
TYPE Timestamp = RECORD
year : [1970..9999] OF CARDINAL;
month : [1..12] OF CARDINAL;
day : [1..31] OF CARDINAL;
hour : [0..23] OF CARDINAL;
minute,
second : [0..59] OF CARDINAL;
millisec : [0..999] OF CARDINAL
END;
(* Operations *)
PROCEDURE fileExists ( CONST path : ARRAY OF CHAR ) : BOOLEAN;
PROCEDURE isDirectory ( CONST path : ARRAY OF CHAR ) : BOOLEAN;
PROCEDURE GetFileSize
( CONST path : ARRAY OF CHAR; VAR size : LONGCARD; VAR s : Status );
PROCEDURE GetPermissions
( CONST path : ARRAY OF CHAR; VAR p : Permissions; VAR s : Status );
PROCEDURE GetCreationTimeStamp
( CONST path : ARRAY OF CHAR; VAR ts : Timestamp; VAR s : Status );
PROCEDURE GetModificationTimeStamp
( CONST path : ARRAY OF CHAR; VAR ts : Timestamp; VAR s : Status );
PROCEDURE CreateFile ( CONST path : ARRAY OF CHAR; VAR s : Status );
PROCEDURE RemoveFile ( CONST path : ARRAY OF CHAR; VAR s : Status );
PROCEDURE CreateDir ( CONST path : ARRAY OF CHAR; VAR s : Status );
PROCEDURE RemoveDir ( CONST path : ARRAY OF CHAR; VAR s : Status );
END FileSystem.