davis has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to write a script that traverses our users' Windows Profiles, looking for large .pst files (Outlook's data store, and it tends to become unreliable past about 1GB of data). Each of the profiles is accessible only by its owner, so a simple File::Find-style approach won't work (AFAICT). I know that backup software can get access to the files via Windows's File Backup API (see here), so I tried looking for a way to create a backup-type program in perl. The best thing I've found so far is here (example 3.8), but that uses Win32::API::Prototype which I can't find via Activestate 5.8.6.

I'm guessing the BackupRead function is available in the kernel32.dll library file, so can I link to it another way? (I'm guessing XS-style trickery)
I'm aware of the (potential) security risks with creating a script with the express intention of bypassing the ACLs, but it's not a problem in this case.


davis
It wasn't easy to juggle a pregnant wife and a troubled child, but somehow I managed to fit in eight hours of TV a day.
  • Comment on Getting access to the Win32 BackupRead API function

Replies are listed 'Best First'.
Re: Getting access to the Win32 BackupRead API function (Win32API::File)
by tye (Sage) on Feb 18, 2005 at 17:10 UTC

    Win32API::File that comes with Perl supports backup semantics for file access. I recall briefly trying to use it and not figuring it out. But Win32API::File exposes the full power of the APIs that it exports so it should just be a matter of figuring out MS docs on the API.

    Win32::API::Prototype is just a wrapper around Win32::API so you can do the translation by hand fairly easily (if you find using Win32::API easy).

    - tye        

      But Win32API::File exposes the full power of the APIs that it exports so it should just be a matter of figuring out MS docs on the API.
      Cool, cheers. I'll look into it.

      davis
      It wasn't easy to juggle a pregnant wife and a troubled child, but somehow I managed to fit in eight hours of TV a day.