[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: A method to set stdin and stdout to binary mode?
- From: lua@...
- Date: Mon, 23 Oct 2006 17:45:07 -0400
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.