Re: Filename for stdout

2010-10-21 Thread Nobody
Richard Gibbs wrote: > If my python script is called with stdout (or stdin or stderr) > redirected to a file, how can I find the filename under Linux?  Under > Windows? On Linux, you can read the /proc/self/fd/* symlinks, e.g.: stdin_filename = os.readlink('/proc/self/fd/0') This isn't

Re: Filename for stdout

2010-10-20 Thread Grant Edwards
On 2010-10-21, James Mills wrote: > On Thu, Oct 21, 2010 at 6:17 AM, Richard Gibbs > wrote: >> If my python script is called with stdout (or stdin or stderr) redirected to >> a file, how can I find the filename under Linux??? Under Windows? > > I don't believe there is a way to do this. There is,

Re: Filename for stdout

2010-10-20 Thread James Mills
On Thu, Oct 21, 2010 at 6:17 AM, Richard Gibbs wrote: > If my python script is called with stdout (or stdin or stderr) redirected to > a file, how can I find the filename under Linux?  Under Windows? I don't believe there is a way to do this. The shell normally takes care of pipes. When you do:

Filename for stdout

2010-10-20 Thread Richard Gibbs
If my python script is called with stdout (or stdin or stderr) redirected to a file, how can I find the filename under Linux? Under Windows? Thanks, RG -- http://mail.python.org/mailman/listinfo/python-list