[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: I/O operations in binary mode
- From: Philippe Lhoste <PhiLho@...>
- Date: Mon, 16 Jul 2001 17:37:56 +0200 (MEST)
Hello.
I am writing a script to parse a binary file and extract some textual
information.
I first used my ProcessFile.lua code template, using readfrom and writeto,
and read"*a". But I quickly found that I had less data that the file has.
I searched the mail archive (I remembered a discussion about binary I/O) and
discovered that the documentation is explicit about the 'b' in openfile
mode...
OK, so I am able to do what I want, but I would like to submit a feature
request:
for the sake of symmetry, you should allow readfrom and writeto to accept an
additional parameter, 1 or 'b', to open the file in binary mode. It
shouldn't break compatibility, and it would be nicer...
If this give problems, or if you think this is unneeded / unnecessary /
annoying / ugly / (you name it), you should at least state explicitely in the
manual that these functions can be used only for text files.
While speaking of the manual, there is a small typo in the openfile section:
This string is *exactlty* what is used in the standard C function fopen
BTW, I have put the index of the manual in the manual.html file itself, it
avoids using the back button too often...
Regards.
--
--._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/
--´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`--
Sent through GMX FreeMail - http://www.gmx.net