open files

Ville Herva vherva at viasys.com
Sun Feb 22 18:13:33 GMT 2004


Hi!

I had a brief look sometime ago at hacking something like this into rsync,
but I didn't find a C API for reparse points. If you make progress, please
keep me (or rsync mailing list) posted!

On Fri, Feb 20, 2004 at 12:26:56PM -0500, you [Jason M. Felice] wrote:
> > jason::
> > Win32 backup semantics : what are these?????
> 
> Like anything else in Windows, it's a kludge ontop of a kludge ontop of
> another kludge in order to fix the original kludge.  Since Windows
> programs can't rely on being able to open files that other programs have
> open, there would be no way to write a useful tape backup program.  To
> fix, they added "backup semantics".  If your process has permission to
> do so, it can request backup semantics which will allow it to open files
> which are already open.  
> 
> Of course it's this sort of thinking which is the reason why the Windows
> API to open a stupid file has seven parameters and a buttload of flags
> and pointers to structures which no longer work in recent versions of
> Windows.  </rant>

Well apart from being kludge, there is some merit to the Windows solution.
I'm not sure what exactly you are referring to with "backup semantics", but
I've understood ntbackup.exe on W2k or newer uses reparse points for backing
up files. That way it is not only capable of reading files that are open for
writing, but also gets a (somewhat) consistent snapshot of the files that
are written to. 

For example, Outlook likes to create mailboxes that are ~1GB. Rsyncing them
takes a considerable amount of time. During that time, Outlook may write all
over the file which mean the rsync's backep up version will be hugely
inconsistent. With a reparse point, the backup file will be a snapshot of
one point of time -- Outlook may have been in the middle of writing
something, but the the situation is similar to a sudden powerloss, and
Outlook has much better chance at recovering.

So do you reparse points by "backup sementics" or "just" being able to read
every open file (backup capability)?
 
> I've received a reply from the Cygwin people that suggests Cygwin
> _always_ uses backup semantics, and a little information about how.  It's
> some pretty hairy code and I'm still deciphering it, but it could be that
> I was authoring that patch for nothing.  I'll post more when I figure it
> out.

Hmm, cygwin always uses backup semantics for what? Everything? The rsync
I've compiled on cygwin does fail to read certain files...


regards,

-- v --

v at iki.fi


More information about the rsync mailing list