Sim68K File I/O
TRAP #15 is used for I/O. Put the task number in D0.
The success of the file handling calls is returned in
D0.W as follows:
0 = success
1 = EOF encountered
2 = Error
3 = File is Read Only (Task 51 & 59 only)
A maximum of 8 files may be open at any
one time.
50 |
Close all files. It is recommended to use this at the start of any program using file handling. |
51 |
Open existing file. |
52 |
Open new file.. |
53 |
Read file |
54 |
Write file |
55 |
Position
file |
56 |
Close file |
57 |
Delete file. |
58 |
Display
File Dialog. Pre: D1 = 0 to display 'Open' dialog D1 = 1 to display 'Save' dialog (A1) Points to a null terminated string that will be used as the request title string (max 256) or A1 = $00000000 to use the default 'Open' or 'Save' depending on D1 (A2) Points to a null terminated string (max 256) containing semicolon separated list of file extensions for use in dialog, e.g. '*.txt;*.pcb',0 or A2 = $00000000 for all file types. (A3) Points to a buffer of sufficient size (max 256) to hold the zero terminated full file path and name. On calling, if this contains a file path and name this will be used as the original file path and name. If the user exits via the cancel button this buffer will remain unchanged. Post: D1 = 0 if user cancelled or just closed D1 = 1 if user hit open/save |
59 |
File operations. Pre: (A1) null terminated file name. D1.L = 0 does file exist? Post: D0.W 0 = file exists 2 = Error 3 = file exists and is Read Only Other values of D1 reserved for future use. |