Re: creating sparse files on win32

Discussion in 'Python' started by Trent Mick, Jul 15, 2003.

  1. Trent Mick

    Trent Mick Guest

    [ wrote]
    > I need to create some sparse files on a win32 system (2000 & 2003
    > Server) in order to do some testing of another application (not
    > python). I have been poking around the win32all extensions (win32file
    > specifically) that come w/ ActivePython but can't find anything that
    > allows me to create a file with the 'sparse file attribute' set.
    >
    > Has anyone done this in python?


    I haven't done this but MSDN teels me here:
    http://msdn.microsoft.com/library/d.../en-us/fileio/base/sparse_file_operations.asp
    that one needs to use the FSCTL_SET_SPARSE control:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/fsctl_set_sparse.asp

    The code sample on the latter link uses the DeviceIoControl() Win32 API
    method:
    >>> import win32file
    >>> win32file.DeviceIoControl

    <built-in function DeviceIoControl>
    Also use this to determine if the file system supports sparse files:
    >>> win32api.GetVolumeInformation

    <built-in function GetVolumeInformation>

    Hopefully that can give you a start.

    Cheers,
    Trent

    --
    Trent Mick
    Trent Mick, Jul 15, 2003
    #1
    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. Sandros
    Replies:
    3
    Views:
    372
    GIMME
    Nov 5, 2004
  2. Dan Stromberg

    sparse sets of integers?

    Dan Stromberg, Apr 4, 2005, in forum: Python
    Replies:
    6
    Views:
    312
    Raymond Hettinger
    Apr 5, 2005
  3. Replies:
    10
    Views:
    843
    Mike Meyer
    Aug 19, 2005
  4. George Sakkis

    Sparse matrices

    George Sakkis, Sep 27, 2005, in forum: Python
    Replies:
    0
    Views:
    413
    George Sakkis
    Sep 27, 2005
  5. KraftDiner
    Replies:
    12
    Views:
    765
    Alex Martelli
    Feb 2, 2006
Loading...

Share This Page