By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,922 Members | 1,689 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,922 IT Pros & Developers. It's quick & easy.

Question about file handles and windows handles @ Windows Operating Systems

P: n/a
Very hard to find right function...

If I open file
fname="c:\\temp\\foobar.txt"
file_foobar = file(fname)
file_foobar.fileno() returns 3 becausee of unix like library used
in windows python....

If I'd like to get to known what windows handle it has

hfile=win32file.CreateFile( ff,win32con.GENERIC_READ|
win32con.GENERIC_WRITE,win32con.FILE_SHARE_READ|
win32con.FILE_SHARE_WRITE,None,
win32con.OPEN_ALWAYS,win32con.FILE_ATTRIBUTE_NORMA L , 0 )

hfile.handle returns 88

Are there any function to get windows handle of file which is already
opened with built-in file-function.

-Eino

May 8 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Are there any function to get windows handle of file which is already
opened with built-in file-function.
mscvrt.get_osfhandle

HTH,
Martin
May 8 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.