Question about file handles and windows handles @ Windows Operating Systems

Discussion in 'Python' started by eino, May 8, 2007.

  1. eino

    eino Guest

    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_NORMAL , 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
     
    eino, May 8, 2007
    #1
    1. Advertising

  2. 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
     
    =?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?=, May 8, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bruce Lee
    Replies:
    11
    Views:
    1,770
    Thomas G. Marshall
    Dec 5, 2004
  2. Santhosh1992

    Computer operating systems

    Santhosh1992, Apr 5, 2008, in forum: Java
    Replies:
    3
    Views:
    361
    Mark Space
    Apr 5, 2008
  3. George

    Computer operating systems

    George, Apr 6, 2008, in forum: Java
    Replies:
    1
    Views:
    380
    George
    Apr 6, 2008
  4. George

    Computer operating systems

    George, Apr 6, 2008, in forum: C++
    Replies:
    10
    Views:
    614
  5. Tim Daneliuk

    Win32All On 64-Bit Operating Systems

    Tim Daneliuk, Mar 17, 2010, in forum: Python
    Replies:
    6
    Views:
    278
    Tim Daneliuk
    Mar 18, 2010
Loading...

Share This Page