lua-users home
lua-l archive

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


Greetings...

  local pipe = assert(io.popen('ls', 'r'))
succeeds, but
  local pipe = assert(io.popen('ls', 'rb'))
gives:
  lua: t:2: ls: Invalid argument
(It doesn't complain about 'rb', it complains about 'ls' !?)
The manpage I found says:
  The mode string can also have a 'b' at the end, which is needed
  in some systems to open the file in binary mode. This string
  is exactly what is used in the standard C function fopen.
Surely binary-mode should work, at least in unix ?
Or does it fail as a warning that windows stdout can't ever
do binary, and unix does binary anyway even with just 'r' ?

('ls' is only an example, the app will involve midi.
 I'm using the debian squeeze lua package Lua 5.1.4)

Regards,  Peter Billam

http://www.pjb.com.au       pj@pjb.com.au      (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