to get name of file opened

Visco Shaun visco31 at gmail.com
Sat Mar 28 08:30:57 EDT 2009


Hi

Is there any way to get the name of the file opened from the file object
'f' which i get through the code 

f = os.fdopen(os.open("trial', os.O_WRONLY|os.O_CREAT), "w")

The situation will be like i can access only the above variable 'f'.
f.name is having '<fdopen>' instead of filename 'trial'

Or if not possible can anyone suggest a solution where my requirements
are
a) i need file access through os module
b) i need file object and not file descriptor as its more easy to use

-- 
Thanks & Regards
visco




More information about the Python-list mailing list