Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Question about file handles and windows handles @ Windows Operating Systems (http://www.velocityreviews.com/forums/t505058-question-about-file-handles-and-windows-handles-windows-operating-systems.html)

eino 05-08-2007 09:00 PM

Question about file handles and windows handles @ Windows Operating Systems
 
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


=?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?= 05-08-2007 09:14 PM

Re: Question about file handles and windows handles @ Windows OperatingSystems
 
> Are there any function to get windows handle of file which is already
> opened with built-in file-function.


mscvrt.get_osfhandle

HTH,
Martin


All times are GMT. The time now is 07:46 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57