to get name of file opened

V

Visco Shaun

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,797
Messages
2,569,647
Members
45,380
Latest member
LatonyaEde

Latest Threads

Top