lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Jon Mayo wrote:
> In my opinion Lua programs shouldn't have to care if it is on
> Windows or POSIX, so I'd call this a bug in the io library for
> not interpreting the mode flags. Or alternatively I would express
> this as, you can't use binary data with io.popen in a portable
> way because you can't reliably pass 'b', which Windows needs.

Sergey Rozhenko wrote:
> Alternatively, *_fmode* may be set to *_O_BINARY* prior to
> calling fopen/popen and then returned to the previous state.
> Then single "r" and "w" would work the same on Windows and
> POSIX. Lua behavior shouldn't depend on things like _fmode.

>From a naive point of view, since "Lua is eight-bit clean"
(PiL p.11) shouldn't binary mode be the default ?

Surely io.lines would be the right place to tame those CRLFs ?

Regards,  Peter Billam      (03) 6278 9410
"Was der Meister nicht kann,   vermöcht es der Knabe, hätt er
 ihm immer gehorcht?"   Siegfried to Mime, from Act 1 Scene 2