Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* Trouble with Scanf and files
@ 2008-01-18  0:51 Christopher Kauffman
  2008-01-18  1:39 ` [Caml-list] " Karl Zilles
  2008-01-18  8:30 ` Olivier Andrieu
  0 siblings, 2 replies; 4+ messages in thread
From: Christopher Kauffman @ 2008-01-18  0:51 UTC (permalink / raw)
  To: OCaml

I have encountered some difficulty using Scanf with a large number of files. As 
suggested in the the Ocaml manual, my strategy so far when reading a number of 
files has been to use Scanf.Scanning.from_file to create a scanbuf for each 
file. I had always wondered if this would cause problems with large numbers of 
files because I could not figure out a way to close a file after completing 
operations on it. Today I attempted to process too many and received a fatal 
system error. If one allocates a scanbuf via

let b = Scanf.Scanning.from_file "somefile" in ...

is there a way to subsequently close the file when the buffer is no longer 
needed? Or is this an issue that should be taken care of by the garbage 
collector in some strange way?

Cheers,
Chris Kauffman


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-01-18 23:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-18  0:51 Trouble with Scanf and files Christopher Kauffman
2008-01-18  1:39 ` [Caml-list] " Karl Zilles
2008-01-18  8:30 ` Olivier Andrieu
2008-01-18 23:12   ` Chris Kauffman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox