--- gforth/blocks.fs 1995/11/07 18:06:32 1.7 +++ gforth/blocks.fs 1996/07/16 20:57:06 1.9 @@ -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 ) @@ -114,7 +118,7 @@ Defer flush-file dup 0= -35 and throw dup get-buffer >r dup r@ buffer-block @ <> - r@ buffer-fid @ block-fid @ <> and + r@ buffer-fid @ block-fid @ <> or if r@ save-buffer dup block-position