lua-users home
lua-l archive

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


Folks,

I am about to write a print-stream filter that needs to run on a Windows
box.  It has to receive the print-stream on stdin and produce a filtered
stream on stdout.  Because I'm dealing with a print-stream (PCL) and I'm
on Windows, I need to put stdin and stdout into binary mode.  Were I in
C, I'd do the following:

  _setmode(fileno(stdin), O_BINARY);
  _setmode(fileno(stdout), O_BINARY);

Programming in Lua says, in section 21.2.2 "Binary Files" that stdin and
stdout are open in text mode.
So...I'm looking for a way to access stdin and stdout in binary mode. 
Is there any way to make this happen in Lua?

Gavin.