|| at Mar 21, 2001 at 12:07 am
You can get the name of an open file from the file object's name attribute:
f = open('foo')
If you always open your files with full absolute paths (rather than relative
to the current working directory) you can then retrieve that path from the
f.name attribute. With a full path, deleting the file is simple:
The os.path module has functions for converting relative paths to absolute
"Gary" <glevenson at mediaone.net> wrote in message
news:RSRt6.2154$nd.2670928 at typhoon.ne.mediaone.net...
Is the best way to do this to just issue a shell command using getstatus or
something similar? I have a file descriptor created with open. I'd rather
not deal with constructing the entire path string if I can avoid it.
Greg Jorgensen / programmer, pedant, raconteur / Portland, Oregon, USA