-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathfileutils.ipf
More file actions
39 lines (29 loc) · 801 Bytes
/
fileutils.ipf
File metadata and controls
39 lines (29 loc) · 801 Bytes
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
#pragma rtGlobals=1 // Use modern global access method.
// fileutils - Utility functions to work with files
#ifndef FILEUTILS_INCLUDE
#define FILEUTILS_INCLUDE
// Open a file for writing and return reference (handle) to it
Function File_openForWrite(filepath)
String filepath
Variable fileref
Open fileref as filepath
return fileref
End
// Open a file for reading and return reference to it
Function File_openForRead(filepath)
String filepath
Variable fileref
Open/R fileref as filepath
return fileref
End
Function File_writeString(fileref, string_in)
Variable fileref
String string_in
FBinWrite fileref, string_in
End
// Close the file pointed to by a file reference
Function File_close(fileref)
Variable fileref
Close fileref
End
#endif