Mail Archives: djgpp/2001/06/05/01:45:22

From: "John H.T. HO" <htho AT ms4 DOT url DOT com DOT tw>
Newsgroups: comp.os.msdos.djgpp
Subject: Reopen stdout in binary mode
Date: Tue, 5 Jun 2001 13:29:05 +0800
Organization: DCI HiNet
Lines: 21
Message-ID: <9fhr5s$>
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi all,

I am developing a program which concatenates 3 object files and do some
operation on it. In my program, I write the result data to "stdout" and then
redirect it to a destination file under bash while the program is executing.

bash$ concate file1 file2 file file3 > destfile

Yet I found that a text mode CR/LF conversion is always done to my result
data, so I always got a wrong file. I have browsed the source codes of DJGPP
bash and found that it process file default in text mode, and this is quite
different from what it used to be under other platform.

Is there a way to reopen the "stdout" in binary mode? Or just treat my
destination file as the 4th parameter and open it in binary mode explicitly?


John H.T. Ho

- Raw text -

  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019