This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Redirection to file becomes garbage


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]