| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | redirection revision |
Please disregard my first posting about this subject...I had two
drafts and sent the wrong one. FT> HdA> appli log
FT> HdA> leaves me with a file of 0 length, whereas without redirection:
FT> HdA> appli < input
FT> HdA> results are written to the screen.
FT> HdA> When i open a stream and write my intermediate info to this stream,
FT> HdA> the streamed file is empty as well, as a result of the trapping.
FT> HdA> So how can i redirect my info (printf) to a file,
FT> HdA> when the program tr
FT>
FT> try (f)pritf(stderr), look up atexit() if on your compiler
FT>
FT> HdA> I am using OS/2 version 2.1. IBMs C compiler (2.01) or Borlands C
FT> HdA> compiler (1.0) produce the same redirection
FT> HdA> behaviour, so it must be
FT> HdA> intrinsic feature of the OS.
FT> HdA> Any idea to solve this dilemma?
FT>
FT> appli log. or appli log
FT> might do it, or a variation thereof. I had to use it once or twice
FT> with some applications that didn't want a redirection either, and
FT> that forced it. Don't remember where I got the info from, but
FT> somebody in this area is bound to know and fill in my (huge) gaps
I would say " appli log " would get the data
that is slated
to go to your screen to be sent to the "log" file. Instead of using
printf for sending error data to stdout (which "appli" probably wants
as the screen) use fprintf (stderr,.....) which sends your debugging
statements to the "log" file by setting up your command line
"appli
log". In order to get info into your "log"
file when OS2 is
about to shut down your "appli", setup and use the SIGNAL functions.
When OS2 is about to shutdown your "appli" it will call one of appli's
signal functions which will allow ONE function to run (the function
could have a statement like fprintf(stderr,"some information" to your
log file)) before shutting down "appli". TTFN Bill Internet address
wchriste{at}eagle.wbm.ca
___
X KWQ/2 1.2i X Windoze is to Productivity as Pancakes are to a BBQ Grill.
--- Maximus/2 2.02
* Origin: OS/2 Shareware BBS, telnet://bbs.os2bbs.com (1:109/347)SEEN-BY: 50/99 54/99 270/101 620/243 625/160 711/401 413 430 934 712/311 407 SEEN-BY: 712/505 506 517 623 624 704 713/317 800/1 @PATH: 109/347 18 17 7 396/1 270/101 712/624 711/934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.