Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] [ANN] The Missing Library
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Benjamin Geer <ben@s...>
Subject: Re: [Caml-list] Re: Common IO structure
Richard Jones wrote:
> Actually me too.  90% of my file IO requirement is to slurp a whole
> file into a string

Sometimes I also do get very large messages, so it's nice if, when 
converting from, say, Arabic EBCDIC encoding to Unicode, I don't have to 
read the entire message as EBCDIC bytes, then convert the whole thing to 
Unicode at once.  It uses much less memory if I can read, say, 1K of 
EBCDIC bytes, convert them to Unicode characters, append them to a 
string buffer, and repeat until done.

Another thing that I get fairly often (though less often) is a file 
containing many messages separated by some delimiter.  In this case I 
want to read through the file, converting bytes to Unicode characters as 
I go along, and looking for the delimiter until I have a whole message 
in a string.  I don't want to read the whole file at once, because it 
might be far too big.

Ben

-------------------
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