Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] Unix.lseek versus Pervasives.pos
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Shivkumar Chandrasekaran <shiv@e...>
Subject: Re: [Caml-list] Unix.lseek versus Pervasives.pos
I went back to my code and put flushes after all writes. It still did 
not help. Furthermore, once I replaced output_value by Unix.write (not 
followed by flushes) lseek worked perfectly well! So I am not sure 
whether the problem is due to non-flushing or not. Furthermore I 
observed that in the Unix module there is no way to flush/sync a file. 
Is it not needed? Apparently not.

--shiv--


On Monday, March 17, 2003, at 11:21 PM, Francois Rouaix (and similarly 
Basile STARYNKEVITCH) wrote:

> You may need to flush the channel. If the data is still in the 
> buffers, the fd position will not have been updated.
>
> --f
>
> On Monday, Mar 17, 2003, at 23:45 Europe/Paris, Shivkumar 
> Chandrasekaran wrote:
>
>> Hi,
>>
>> Currently I am trying to handle "LargeFiles" while marshalling caml 
>> values and I have run into this incidental problem (nothing to do 
>> with LargeFile). If I open a file with "open_out_bin", write to it 
>> using "output_value" and then try to determine the position in the 
>> file using "pos", I get the correct value. However, if I use 
>> Unix.lseek > thus
>>
>> Unix.lseek (Unix.descr_of_out_channel fd_out) 0 Unix.SEEK_CUR
>>
>> I get a different value (so far always 0) than the one I get from
>>
>> pos fd_out
>>
>> The manual does not seem to help. Any advice will be appreciated. 
>> Thanks,
>>
>> --shiv--
>>
>> -------------------
>> To unsubscribe, mail caml-list-request@inria.fr Archives: 
>> http://caml.inria.fr
>> Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: 
>> http://caml.inria.fr/FAQ/
>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>>
>>
>
>
--shiv--

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners