--- gforth/blocks.fs 1995/11/07 18:06:32 1.7 +++ gforth/blocks.fs 1996/05/07 16:15:21 1.8 @@ -58,15 +58,19 @@ block-cold Defer flush-file : use-file ( addr u -- ) - 2dup r/w bin open-file 0<> + 2dup ['] open-path-file catch 0<> if - drop r/w bin create-file throw + 2drop r/w bin create-file throw else - nip nip + rot close-file throw 2dup file-status throw bin open-file throw + >r 2drop r> then block-fid @ IF flush-file block-fid @ close-file throw THEN block-fid ! ; +: use ( "file" -- ) + name use-file ; + \ the file is opened as binary file, since it either will contain text \ without newlines or binary data : get-block-fid ( -- fid )