Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!psuvax1!psuvm!barilvm!bimacs!goren From: goren@bimacs.BITNET (goren yoram) Newsgroups: comp.sys.amiga Subject: \0 and open Keywords: 2 problems Message-ID: <1828@bimacs.BITNET> Date: 6 Jun 90 09:08:01 GMT Organization: Math & CS, BarIlan U, Ramat-Gan, Israel Lines: 51 I had to send the character \0 to my printer. I tried : fp = fopen ("PAR:", "w") fprintf (fp, "aaa\000bbbb") fprintf (fp, "aaa%cbbbb", 0x00) The first sent until (not including) the \0, and the second just ignord it. I also tried: FileHandle *fh, *Open () unsinged char c; c = 0; fh = Open ("PAR:", O_WRONLY) (worked fine) Write (fh, &c, 1L) (write failed) and int fd, open () fd = open ("PAR:", O_WRONLY) (worked fine) write (fd, &c, 1L) (the program was stuck) What did I do wrong, and what is the right way to send 0x00 to the printer? (I use Aztec 3.6a, and a A1000 with 1.5 MB of memory) Thanks, Goren BITNET goren@bimacs Arpanet goren%bimacs.bitnet@cunyvm.cuny.edu UUCP ...!psuvax1!bimacs.bitnet!goren or: ...!uunet!goren@bimacs.bitnet ----------------------------------------------------------------------- | Always look on the bright side of life.... | ----------------------------------------------------------------------- -- BITNET goren@bimacs Arpanet goren%bimacs.bitnet@cunyvm.cuny.edu UUCP ...!psuvax1!bimacs.bitnet!goren or: ...!uunet!goren@bimacs.bitnet ----------------------------------------------------------------------- | Always look on the bright side of life.... | -----------------------------------------------------------------------