Hi Jim:
        That part worked thanks! However, if have not gotten
the results that I had hoped for.
I had assumed that skip fp 10 would take me to offset
10. It appears that it has not.

TestBin.txt contains the characters:
"abcdefghijklmnopqrstuvwxyz"

The following code :
;===============================================================
fp: open/read/direct/binary %TestBin.txt
skip fp 10
print to-string buffer: copy/part fp 10
close fp
;===============================================================
produces:

>> do %BinFile.r
abcdefghij

The result I would be looking for in buffer
would be "klmnopqrst"

So it appears that skip fp 10 is not advancing
the "file pointer" to offset 10.

what would I do to make that happen?
Thanks
Tim

At 09:21 PM 7/15/00 -0700, you wrote:
>At 08:11 PM 7/15/2000 -0800, you wrote:
>>I want to open a file for read-only binary access.
>>Move to a specific offset in the file and read a
>>specific number of bytes:
>>I've tried this, but I'm doing something wrong
>>
>>fp: open/read/direct/binary %TestBin.txt
>>skip fp 10  ;move to offset 10
>>buffer: read/part 10 ;error here, want to read 10 bytes
>
>this should be:
>
>buffer: copy/part fp 10
>
>  - jim
>
>
>>close fp
>>
>>Advice Welcome!
>>Thanks
>>Tim
>
>

Reply via email to