No. Redirection, piping and general screen printing are facilities of the OS, not your program. Additionally, there are other tools, such as tee which would complicate the matter if you could. Suppose you had ./a.out | tee a.txt would you want that tee was receiving your output or that it was ultimately sent to a.txt?
L7Sqr
Practically a Posting Shark
866 posts since Feb 2011
Reputation Points: 253
Solved Threads: 155
Skill Endorsements: 7