[EMAIL PROTECTED] wrote:
> 
> Hello [EMAIL PROTECTED],
> 
> On 17-Jul-00, [EMAIL PROTECTED] wrote:
> 
> > As per your instructions: Here is the code
> > fragment with your suggested changes:
> > ;============================================
> > fp: open/read/binary/direct %TestBin.txt  ;
> > fp: skip fp 10
> > print to-string buffer: copy/part fp 10
> > close fp
> >>> do %BinFile.r
> > abcdefghij
> >
> > This is on Win NT 4.0
> > What type of machine are you using?
> > Did it actually work for you.
> > Thanks for looking at this!
> > Tim
> 
> Unfortunally REBOL seems to have some bugs/inconsistencies in this area.
> I've confirmed your results on REBOL 2.3.0.1.1 (Amiga).
> 
> For now you could try dropping the /binary statement and use 'read-io instead.
> 
> Seem's to work here:
> 
> ## fp: open/read/direct %testbin.txt
> ## fp: skip fp 10
> ## buffer: make binary! 10
> == #{}
> ## read-io fp buffer 10
> == 10
> ## print buffer
> #{6B6C6D6E6F7071727374}
> ## print to-string buffer
> klmnopqrst

I've also been having trouble with the skip command on large files.  For
example, I'm testing out the ftp restarting code, so I can download a 33
meg file, and if the connection is dropped after 10 megs have been
downloaded, I can just continue on with the remaining 23 megs.  But, I
have a couple of problems...

Firstly, using 'write/append/direct/binary %file.bin large-buffer', if
the large-buffer is 1 meg in size (for example), each time I call
write/append, Rebol allocates 1 more meg of memory, which is very
annoying.  I could put a 'recycle' after calling write, but I figured I
could just use open and skip.

So I try -

>> foo: open/binary/direct/write %file.bin
>> foo: skip foo foo/size
...

which should set the file position to the tail, but it crashes.  If I
use 'foo: open/direct/write %file.bin' instead, it doesn't crash, but
the file position is only moved a small distance, like 10000 bytes.  So
then if I try and write some data, thinking that I'm appending to the
file, I'm just writing over the existing data.  There's definitly some
wierd voodoo magic going on :)

Julian Kinraid

Reply via email to