| Defer flush-file |
Defer flush-file |
| |
|
| : use-file ( addr u -- ) |
: use-file ( addr u -- ) |
| block-fid @ IF flush-file block-fid @ close-file throw THEN |
|
| 2dup r/w bin open-file 0<> |
2dup r/w bin open-file 0<> |
| if |
if |
| drop r/w bin create-file throw |
drop r/w bin create-file throw |
| else |
else |
| nip nip |
nip nip |
| then |
then |
| |
block-fid @ IF flush-file block-fid @ close-file throw THEN |
| block-fid ! ; |
block-fid ! ; |
| |
|
| \ the file is opened as binary file, since it either will contain text |
\ the file is opened as binary file, since it either will contain text |