darkreaper00
Technical User
I have a program for which the user specifies the output as an argument in the commandline -- i.e.
puts my program's output to STDOUT into a file named filename. I want to know how I can capture that name from within my program, without evaluating the arguments from the command line. Naturally, things like
give me
Is there a simple command to capture the filename (or "-" if lacking, right?) STDOUT points to? The big picture is the need to create multiple output files on occasion, and I want to let them be
, etc., if the user has supplied
as his output file argument. I'm fine with getting there, once I can get my hands on that filename.
Thanks!
t
Code:
> filename
Code:
$filename = *STDOUT;
$filename2 = \*STDOUT;
give me
Code:
*main::STDOUT
GLOB(0X14000ed60)
Is there a simple command to capture the filename (or "-" if lacking, right?) STDOUT points to? The big picture is the need to create multiple output files on occasion, and I want to let them be
Code:
filename_01.x, filename_02.x
Code:
filename.x
Thanks!
t