Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Question about file handles and windows handles @ Windows Operating Systems

Reply
Thread Tools

Question about file handles and windows handles @ Windows Operating Systems

 
 
eino
Guest
Posts: n/a
 
      05-08-2007
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

 
Reply With Quote
 
 
 
 
=?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?=
Guest
Posts: n/a
 
      05-08-2007
> Are there any function to get windows handle of file which is already
> opened with built-in file-function.


mscvrt.get_osfhandle

HTH,
Martin
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A-Z about Operating systems and other programming languages Gokul Python 0 03-21-2008 01:41 AM
The rules for daylight saving and old operating systems Matty F NZ Computing 25 11-03-2006 11:11 PM
Voip PBX,Private Phone Systems,PBX Telephone Systems, Business Phone Systems broadbandera@gmail.com UK VOIP 9 07-24-2006 03:44 PM
Fujitsu Siemens Computers supporting Microsoft's Windows x64 operating systems Christian Hougardy \(MS XP MVP\) Windows 64bit 0 07-24-2005 10:28 AM
OT: If Operating Systems were Airlines =?iso-8859-1?Q?Frisbee=AE_MCNGP?= MCSE 95 01-26-2004 06:47 PM



Advertisments
 



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