Hi,

I need some clarifications on the usage of io__seek_binary.

The pred is written as
:- pred io__seek_binary(io__binary_stream, io__whence, int, 
io__state, io__state).

io__whence is defined as
:- type io__whence --->
     set
;   cur
;   end

What I understand io__binary_stream is the specified binary 
stream, io__whence will specify set or cur or end, and int will 
specify the position in the file in the binary output stream.

In the file documentation it says that it offsets relative to 
Whence on the specified output stream. What I understand it means, 
it will compensate the position in the binary stream

What I understand is that the syntax would be
io__seek_binary(BinaryStream, cur, 10)

I have some queries regartding the usage of the syntax...
1) io__seek_binary(BinaryStream, set, 10)
set is seeking to the start of the file, so plz do tell me if the 
above syntax would work. How would the start of the file be 10??

2) io__seek_binary(BinaryStream, cur, 10)
cur seeks relative in the file. What would happen if the current 
position would be 15 in the above syntax??

3) io__seek_binary(BinaryStream, end, 10)
end seeks relative to the end of the file. What would happen if 
the current position in the file is 20 and is not the last 
line??

4) Plz do tell me if I have interpreted the syntax in a wrong way. 
If yes, plz tell me the correct syntax.

5) if the synatx could be explained, it would be helpful.

Thanks and Regards,

Noel
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users@cs.mu.oz.au
administrative address: owner-mercury-users@cs.mu.oz.au
unsubscribe: Address: mercury-users-request@cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request@cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------

