Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Trouble with Scanf and files
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-01-18 (23:12)
From: Chris Kauffman <kauffman@c...>
Subject: Re: [Caml-list] Trouble with Scanf and files
Most interesting - I used Scanf.Scanning.from_file as the
documentation states that it uses block reads that are easier on the
I/O system than Scanning.from_channel. I rewrote using instead the
standard Pervasives.open_in and the associated input_line and
Scanf.sscanf; this seems to work fine for my purposes.

Olivier seems to have hit the nail on the head: if the end of a file
is not reached with Scanning.from_file, it stays open with essentially
no way to close it (other than artificially scanning to the end). I
think this issue is worth a bug report so I'll see if I can submit

Thanks for helping to resolve this.