From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id HAA08863; Tue, 18 Mar 2003 07:54:15 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id HAA09246 for ; Tue, 18 Mar 2003 07:54:14 +0100 (MET) Received: from kraid.nerim.net (smtp-102.nerim.net [62.4.16.102]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h2I6sDX01367 for ; Tue, 18 Mar 2003 07:54:14 +0100 (MET) Received: from hector.lesours (lesours.starynkevitch.net [80.65.224.217]) by kraid.nerim.net (Postfix) with ESMTP id 2CE0240F12 for ; Tue, 18 Mar 2003 07:54:11 +0100 (CET) Received: from basile by hector.lesours with local (Exim 3.36 #1 (Debian)) id 18vAzF-0004Vt-00 for ; Tue, 18 Mar 2003 07:54:13 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <15990.49813.28217.829156@hector.lesours> Date: Tue, 18 Mar 2003 07:54:13 +0100 To: caml-list@inria.fr Subject: [Caml-list] Unix.lseek versus Pervasives.pos In-Reply-To: <2EECE9D8-58CA-11D7-A8F0-000393942C76@ece.ucsb.edu> References: <2EECE9D8-58CA-11D7-A8F0-000393942C76@ece.ucsb.edu> X-Mailer: VM 7.11 under Emacs 21.2.2 From: Basile STARYNKEVITCH X-Spam: no; 0.00; basile:01 caml-list:01 lseek:01 pervasives:01 shivkumar:01 shiv:01 marshalling:01 largefile:01 flushing:01 generic:01 faiencerie:01 92340:01 reine:01 bin:01 nerim:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >>>>> "Shivkumar" == Shivkumar Chandrasekaran writes: Shivkumar> Hi, Currently I am trying to handle "LargeFiles" while Shivkumar> marshalling caml values and I have run into this Shivkumar> incidental problem (nothing to do with LargeFile). If I Shivkumar> open a file with "open_out_bin", write to it using Shivkumar> "output_value" You apparently forgot to flush the channel. Shivkumar> and then try to determine the position Shivkumar> in the file using "pos", I get the correct Shivkumar> value. However, if I use Unix.lseek thus Shivkumar> Unix.lseek (Unix.descr_of_out_channel fd_out) 0 Shivkumar> Unix.SEEK_CUR Shivkumar> I get a different value (so far always 0) Forgetting to flush files on most systems should give similar errors. Flushing files is not Ocaml specific, but a general issue (at least under Unix, and probably Windows). Perhaps the Ocaml manual could add as a hint to never forget flushing files (but the tip might be there already), but this hint is very basic & generic and is not Ocaml specific. Regards. -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basilestarynkevitchnet aliases: basiletunesorg = bstarynknerimnet 8, rue de la Faïencerie, 92340 Bourg La Reine, France ------------------- 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