[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: io.popen(s, 'rb') ?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Sun, 3 Oct 2010 11:08:06 -0300
> On POSIX systems you wouldn't use 'b'. But on Windows
> (http://msdn.microsoft.com/en-us/library/96ayss4b%28VS.80%29.aspx )
> the 'b' is required for a binary mode.
>
> 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.
You cannot use io.popen in a portable way, binary data or not.
-- Roberto