delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/08/06/17:18:59

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <20010806161837.F3738@psyphw.psych.wisc.edu>
Date: Mon, 6 Aug 2001 16:18:37 -0500
From: John Koger <joviko AT psyphw DOT psych DOT wisc DOT edu>
To: cygwin AT cygwin DOT com
Subject: Redirection to file becomes garbage
Mime-Version: 1.0
X-Mailer: Mutt 0.93.2i

I'm having an odd problem that I couldn't find any hints about in the
FAQ or mailing lists.

I've written a C-based CD data archiving program which does many system() 
calls to fairly memory- and disk-intensive tools (including big 'find' and
'sort' jobs and 'cdrecord').

The system() calls always redirect the output of the tools to a log file;
for example,

	...
	sprintf(command,
		"cdrecord dev=%s -eject >> %s 2>&1",
		archiveDrive, logFileName);
	err = system(command);
	...

In addition, the program fprintf()s to the log file itself (and does an
fflush() of the log file handle each time).

Everything works fine under Linux (RH 6.2). Under CygWin (on Windows
98SE), everything also works fine, except that after a while, the contents
of the log file become garbage (the log file is readable up to a point,
then looks like a binary memory dump). The "garbage point" varies, and
doesn't seem to relate to any specific command.

Is my program running out of some resource (like heap space, maybe)? Or
is there an environmental limit under DOS/Cygwin (like something on
the CONFIG.SYS line

	shell=C:\command.com /e:4096 /p

needs to be increased or changed? Or, is appending to a file that other
(sub)processes are writing to not totally kosher under CygWin?

Any thoughts or ideas are much appreciated.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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