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

So far so good, here comes the odd stuff:

## print fp/state/fpos
0

hmm, there's a file position indicator (I guess :-), but it isn't updated...

## print length? fp/state/inbuffer
6

What? didn't I say "no buffering"

## print fp/state/inbuffer        
uvwxyz

Seems not...


This (among other things) seems like a bug and should probably be reported to 
feedback...


Best regards
Thomas Jensen

Reply via email to