Saving all xterm output to a file
Larry Hall (Cygwin X)
reply-to-list-only-lh-x@cygwin.com
Mon Feb 9 02:33:00 GMT 2009
teddybouch wrote:
>
>
> Jon TURNEY wrote:
>>
>> If you really want to prove this is an xterm issue (which seems unlikely
>> to me
>> as this really revolves about what bash is doing), you should compare the
>> behaviour between running the command under an xterm and running it under
>> some
>> other terminal emulator (e.g. the 'cygwin bash shell' menu shortcut which
>> starts bash inside the native 'DOS window')
>>
>>
>
> I'm not really partial to proving that this is an xterm issue - I just want
> to get it working the way I need it to. Right after I write this email I'm
> going to make another version of my control program that writes directly to
> a file and see if that will give me everything that I need. I took your
> advice and tried it under the cygwin bash shell and got the same problem, so
> I assume that it's not an xterm issue, but as you suggest, a bash issue. If
> this isn't the place to find help for that, could someone direct me to the
> correct venue, please?
For non-X issues, you want the main Cygwin list. But before jotting off a
note there, see below.
> As to the issue of changing output, I'm sorry that the parameters for the
> different results were ambiguous. The input was the same for all of them.
> The change in output is not a progressive thing - it's just that sometimes
> the printf statements in my code get written to the specified file and other
> times they do not. Interestingly enough, the printf statements in the
> portion of the code that I didn't write do get output consistently. They are
> each followed by called to fflush(stdout) - might this have something to do
> with it?
This has _everything_ to do with it. You're obviously suffering from
buffered I/O. Employ the same technique as you've found in other areas
and I expect your program will output everything like you expect when you
expect it.
--
Larry Hall http://www.rfk.com
RFK Partners, Inc. (508) 893-9779 - RFK Office
216 Dalton Rd. (508) 429-6305 - FAX
Holliston, MA 01746
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ: http://x.cygwin.com/docs/faq/
More information about the Cygwin-xfree
mailing list