Windows I/O Filter Driver

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • catoblepa80
    New Member
    • Feb 2010
    • 4

    #1

    Windows I/O Filter Driver

    Good morning,
    i'm developing an application for my company, in particular i have this need.. i have to copy a file from a place to another (tipically a network storage).
    i have the problem when the file is opened, in particular when during copy the file is modified, how can i create a "snapshot" of the file?
    Searching on internet i found that something can be done writing a filter driver for the file system.


    thank you
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Are you saying that the file is modified by the copy but you wanted an exact copy or that you want to modify the file as you copy it?

    I ask because you sound like you want an unmodified copy but Filter Drivers look like they are for transparently modified copies.

    If you want an unmodified copy but are getting modified copies then you are probably opening one of the files in text mode and the other in binary to perform the copy. Also couldn't you just call CopyFile from the WIN32 API which should just do the job for you?

    Surely you can just

    Comment

    • catoblepa80
      New Member
      • Feb 2010
      • 4

      #3
      i have a set of problems...

      1) if the file is opened with exclusive access by another process?? how can i read it? the copy file or binary openin throws an exception
      2) if the file is very big? like a database (edb, pst, access, mssql ecc, >= 1gb), i cannot hold it for a long time during copy. i need a copy "on the fly", like a lot of backup software do.

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        1) You can.t. There is nothing you can do about it except try again later, exclusive access is exclusive access.

        2) If you are sure no-one else is trying to access it copy it in small chunks, say 8 - 64k at a time. Whatever size you choose make it a binary power multiple of 512.

        Comment

        Working...