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

Re: Learning C



> To print to the printer you can write your output as a temporary file (either
> plain text or something that your printer understands) and then use the "system"
> function to execute the shell command "cat temp.file > /dev/lp0"
> 
> It's sort of cheating but it should work.

That is true, but there is another way that would be closer to the 
"stdprn" method (which I've never heard of either).

If you open a "pipe" file (popen) to the print command, you can write
data to the pipe file just like a normal disk file, and whatever you 
write to the pipe will be printed when you close it.

Just like what I envision "stdprn" would be!   :-)

--------------------------------------------
Bruce Smith                bruce@armintl.com
System Administrator / Network Administrator
Armstrong International, Inc.
Three Rivers, Michigan  49093  USA
http://www.armstrong-intl.com/
--------------------------------------------