[Box Backup] lstat() and pagefile.sys

Pascal Lalonde boxbackup@fluffy.co.uk
Mon, 28 Nov 2005 15:08:19 -0500

I'm having a problem with bbackupd under win32. It stops with
Exception (1/9) when I encounter pagefile.sys. It is thrown in
SyncDirectory from bin/bbackupd/BackupClientDirectoryRecord.cpp, when
lstat() returns an error.

While debugging, I found out that CreateFileW returns a "sharing
violation" error, meaning another process is accessing the file, which I
believe is normal for pagefile.sys.

Now I think ourstat() from emu.cpp should catch that error and return an
appropriate code, and the caller should proceed with the next file.

In emu.cpp, in ourstat()'s code:
//Question to Ben:
//If this fails the exception takes us all the way out
//are ther not times when you still want to continue with the

I'm not Ben, but personnally, I'd say it is normal to see "sharing
violation", so an exception from lstat() should not end the process, at
least under Win32.

I'd suggest setting errno to EACCES and continuing with the next file,
which should not cause problems under UNIX. Also, there may be some
cases in which lstat() fails on UNIX, for example a file is erased
between readdir() and lstat(). Should that really force bbackupd to exit?

Pascal Lalonde