Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Qt console: Get text from text file as a console input parameter
sitesv last edited by sitesv
Is it possible to do something like this: "cat file.txt | ./myapp" for WINDOWS in Qt Creator debug mode?
JonB last edited by JonB
I think you are asking: "Can I have stdin redirected when I start to debug my program?". And, to make it even harder, you want it to come from the output of a process, not just from a file?
I believe you will struggle with this. I'm not even sure I can see how to do that for
gdb. You say Windows, but give no indication while debugger you are using.
Until someone answers better, I would say "no" to you. But I shall read with interest if someone says it can be done.
You can sett command-line arguments. I don't know if it would allow redirection via
< file.txt--- I would expect it does not (since the shell is what does that). Even if it does, that won't allow for input-from-a-command-pipe.
From your example, it's just equivalent to setting stdin to read from file
file.txt. If you do not get a satisfactory solutuon, would you consider changing your program's command-line arguments (even if only for debugging) to allow e.g.
myapp -i file.txt? It would sure me a lot simpler/quicker? :)
sitesv last edited by
@JonB, I believed that there is a simple analog for windows. Ok, thank you, I will work with file in the app.