I have a console application that crashes with an I / O 6 error when the output is redirected to a file. This is probably due to the fact that the console application changes the color of the text, which does not make much sense in the file.
c:\dir\app.exe
c:\dir\app.exe >out.txt
When I set >out.txtas a parameter in the IDE ( run\parameters\parameters\), I just get >out.txtas a parameter.
>out.txt
run\parameters\parameters\
How to debug an application using stdout redirected to a file instead of a console?
The redirection is performed by the command line interpreter; in windows it is cmd.exe
, cmd.exe propers, , :
cmd.exe/c "yourapplication.exe > redirect.txt"
IDE , cmd.exe - (Run/Parameters):
, , cmd.exe( Project/Load) "Run to first source" :
... .
:
ReadLn;, Delphi
ReadLn;
( p > out.txt)
Delphi, (Run | Attach to Process...), ,
Run | Attach to Process...
: :
asm int 3 end;
Make sure it fails due to directory permissions. Fully qualify the output file path to where you might be able to write. Otherwise, Windows7 may play games with a directory. (VirtualStore material).