home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!hal.com!darkstar.UCSC.EDU!cats.ucsc.edu!banshee
- From: banshee@cats.ucsc.edu (Wailer at the Gates of Dawn)
- Newsgroups: comp.lang.c
- Subject: Re: How do you read binary data piped into stdin?
- Keywords: stdin, redirection, binary data
- Message-ID: <1jpk1mINN4f5@darkstar.UCSC.EDU>
- Date: 22 Jan 93 20:05:10 GMT
- References: <N0gRXB1w165w@eastwind.mcds.com>
- Organization: University of California, Santa Cruz
- Lines: 19
- NNTP-Posting-Host: am.ucsc.edu
-
-
- chorn@eastwind.mcds.com (Christopher Horn) writes:
- >I'm relatively new to C, so still have a lot to learn, so I apologize
- >if this is a silly question. I need to read raw binary data from
- >stdin (it is being piped in) but it appears stdin operates in text
- >mode. The first ascii 26 that comes along triggers end of file, and
- >I can't read the rest of the data. Could someone please explain, or
- >better yet show me a short peice of code, that could do this? The
- >answer is probably obvious, but it eludes me at the moment. Thanks
- >a lot!
-
- Basically I'd think you'd want to close fd 0 (stdin) and open a new input
- in a binary mode. Difficulty will differ depending on the system you're on.
-
- --
- The Wailer at the Gates of Dawn | banshee@cats.UCSC.EDU |
- Just who ARE you calling a FROOFROO Head? | |
- DoD#0667 "Just a friend of the beast." | banshee@ucscb.UCSC.EDU |
- 2,3,5,7,13,17,19,31,61,89,107,127,521,607....| banshee@ucscb.BITNET |
-