[REBOL] Re: areas, text, and read/binary
From: reboler:programmer at: 13-Feb-2002 9:34
Thanks all (esp. Brett) for your input.
I think I understand enough now to better ask the proper question:
Is there a way to process a file that has been opened with 'read/binary, as if you had
opened it as plain 'read?
I was hoping that 'to-string - ing the file would do it, but it is not.
------ some background ----- (only for the truly interested :) )
My script reads all types of files and displays them in their appropriate format (images
as pictures, .txt and .r as text, etc)
or allows you to view them in other formats (hex, base-64, picture-as-text, rot-13, etc).
It also allows you to edit/compress/encrypt them, and view them normally even while compressed/encrypted.
You can also copy/move/delete. And there is where the problem is: I would like to do
these things with the option of NOT changing the original operating system format. In
other words at the time of the 'read I don't know what I am going to do with file, I
may or may not change it, I may or may not move it somewhere else. For example, I might
want to edit and move a text file WITHOUT changing it's line terminators.
Or I might want to move an encrypted text file without changing anything (so it can still
Also, because of the editing capabilities of the script (and for speed), I am trying
to avoid doing extra 'reads.
If I could 'read/binary all files, and then process it at the 'write and pre-write stages
it would make the script very much more simple.