Hi,
If I compile a project the -gh (Heaptrc unit), how to I capture the output generated when I quite the application to a file?
I tried the normal: $./text > out.log
But that doesn't work... the out.log is empty.
Regards,
- Graeme -

Mailing lists / fpc-pascal / 2007-11
11 messages · 6 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi,
If I compile a project the -gh (Heaptrc unit), how to I capture the output generated when I quite the application to a file?
I tried the normal: $./text > out.log
But that doesn't work... the out.log is empty.
Regards,
- Graeme -
[ Charset ISO-8859-1 unsupported, converting... ]
./something >& out.log
however units like crt might make this not possible. The exact solution for that differs with application.
If I compile a project the -gh (Heaptrc unit), how to I capture the output generated when…
RTFM for the log=... use
http://www.freepascal.org/docs-html/rtl/heaptrc/environment.html
if no filename is given, it outputs to stderr and not stdout.
Vincent
[ Charset ISO-8859-1 unsupported, converting... ] ./something >& out.log however units…
You can also set an environment variable.
http://www.freepascal.org/docs-html/rtl/heaptrc/environment.html
Darius
[ Charset ISO-8859-1 unsupported, converting... ] ./something >& out.log however units…
Marco van de Voort wrote./something >& out.log
That didn't work...
Regards,
- Graeme -
_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
RTFM for the log=... use http://www.freepascal.org/docs-html/rtl/heaptrc/environment.html…
Vincent Snijders wroteRTFM for the log=... use http://www.freepascal.org/docs-html/rtl/heaptrc/environment.html
Thanks Darius and Vincent. I'm new to heaptrc and just tried it out. For some reason I didn't even think to look for docs... My bad.
Regards,
- Graeme -
_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
That didn't work... - Graeme - _______________________________________________ fpGUI - a…
./something.sh > log.txt 2>&1 will redirect both stdout and stderr to log.txt. a useful trick...
henry
That didn't work... - Graeme - _______________________________________________ fpGUI - a…
Maybe you use another shell than Marco (that's [t]csh), you could look at the man page for your in the part "output redirection" or similar.
For sh and maybe bash getting stdout and stderr in the file
./something 2>&1 out.log
should do. I didnt test, but getting stderr only may work like this:
./something 2> out.log
HTH,
Marc
./something.sh > log.txt 2>&1 will redirect both stdout and stderr to log.txt. a useful…
Henry Vermaak wrote./something.sh > log.txt 2>&1 will redirect both stdout and stderr to log.txt. a useful trick...
Thanks Henry, this also works.
Regards,
- Graeme -
_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
Maybe you use another shell than Marco (that's [t]csh), you could look at the man page…
I use bash and the above doesn't work... Henry's example of ./something > log.txt 2>&1 works though.
Regards,
- Graeme -
_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
Maybe you use another shell than Marco (that's [t]csh), you could look at the man page…
That doesn't work, it would only for piping:
./stdfile 2>&1 | cat > out.log
But the rest was okay. Henry got it right however ...
Marc