[Box Backup-dev] changeset [819]
Chris Wilson
boxbackup-dev@fluffy.co.uk
Thu, 31 Aug 2006 09:06:44 +0100 (BST)
Hi Martin,
On Wed, 30 Aug 2006, Martin Ebourne wrote:
> I can't see why this code from bin/bbstored/BackupCommands.cpp needs to
> be conditionalised:
On Windows, we cannot reuse the same recombinetemp file, because we still
have it open so we can't delete the old one, so we can't create a new one
with the same name. Therefore, I added a unique part to the end of the
filename (p). This would probably also work on other platforms, so I can
remove the conditionality if you prefer.
The larger problem is that, on Windows, we never delete these temp files!
It's OK for unit tests, but would be horrible for a real store.
Cheers, Chris.
> +#ifdef WIN32
> + std::ostringstream fs(rContext.GetStoreRoot());
> + fs << ".recombinetemp.";
> + fs << p;
> + std::string tempFn(fs.str());
> + tempFn =
> RaidFileController::DiscSetPathToFileSystemPath(rContext.GetStoreDiscSet(), tempFn, p + 16);
> +#else
> + std::string
> tempFn(RaidFileController::DiscSetPathToFileSystemPath(rContext.GetStoreDiscSet(), rContext.GetStoreRoot() + ".recombinetemp", p + 16 /* rotate which disc it's on */));
> +#endif
--
_ ___ __ _
/ __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK |
/ (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer |
\ _/_/_/_//_/___/ | We are GNU-free your mind-and your software |