-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFileutils.def
73 lines (58 loc) · 3.18 KB
/
Fileutils.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
(*!m2r10*) (* Copyright (c) 2015 B.Kowarsch. All rights reserved. *)
DEFINITION MODULE Fileutils;
(* File Utility Interface for Modula-2 R10 Core Compiler *)
(* --------------------------------------------------------------------------
* function fileExists(path)
* --------------------------------------------------------------------------
* Returns TRUE if path is a valid pathname to an existing file system entry,
* otherwise FALSE.
* --------------------------------------------------------------------------
*)
PROCEDURE fileExists ( CONST path : ARRAY OF CHAR ) : BOOLEAN;
(* --------------------------------------------------------------------------
* function isDirectory(path)
* --------------------------------------------------------------------------
* Returns TRUE if path is a valid pathname to an existing directory,
* otherwise FALSE.
* --------------------------------------------------------------------------
*)
PROCEDURE isDirectory ( CONST path : ARRAY OF CHAR ) : BOOLEAN;
(* --------------------------------------------------------------------------
* function isRegularFile(path)
* --------------------------------------------------------------------------
* Returns TRUE if path is a valid pathname to an existing regular file,
* otherwise FALSE.
* --------------------------------------------------------------------------
*)
PROCEDURE isRegularFile ( CONST path : ARRAY OF CHAR ) : BOOLEAN;
(* --------------------------------------------------------------------------
* procedure getFileSize(path, valid, size)
* --------------------------------------------------------------------------
* Tests if path is a valid pathname indicating an existing regular file and
* if so, passes TRUE in out-parameter valid and the file's size in out-para-
* meter size. Otherwise it passes FALSE in out-parameter valid and leaves
* out-parameter size unmodified.
* --------------------------------------------------------------------------
*)
PROCEDURE GetFileSize
( CONST path : ARRAY OF CHAR; VAR valid : BOOLEAN; VAR size : LONGCARD );
(* --------------------------------------------------------------------------
* procedure GetFileTime(path, valid, time)
* --------------------------------------------------------------------------
* Tests if path is a valid pathname indicating an existing regular file and
* if so, it passes TRUE in out-parameter valid and the file's last modifica-
* tion time to out-parameter time. Otherwise it passes FALSE in out-para-
* meter valid and leaves out-parameter time unmodified.
* --------------------------------------------------------------------------
*)
PROCEDURE GetFileTime
( CONST path : ARRAY OF CHAR; VAR valid : BOOLEAN; VAR time : LONGINT );
(* --------------------------------------------------------------------------
* procedure NewPathWithCurrentWorkdir(path)
* --------------------------------------------------------------------------
* Returns a newly allocated NUL terminated character string containing the
* absolute path of the current working directory. Returns NIL on failure.
* --------------------------------------------------------------------------
*)
PROCEDURE newPathWithCurrentWorkdir : String;
END Fileutils.