[Box Backup] Nick - Win32 port.

Scott McNee boxbackup@fluffy.co.uk
Wed, 18 May 2005 11:27:11 +1000


Hi Nick Ben has suggested that I contact you to obtain a copy of the Native
Win32 code.
Who? What? Where? How? When?

Thanks.

Scott McNee



-----Original Message-----
From: boxbackup-admin@fluffy.co.uk [mailto:boxbackup-admin@fluffy.co.uk] On
Behalf Of Ben Summers
Sent: Monday, 16 May 2005 7:51 PM
To: boxbackup@fluffy.co.uk
Subject: Re: [Box Backup] Wanting to write a new program.



On 16 May 2005, at 09:52, Scott McNee wrote:

> Hi All,
>             Thankyou for writing a very complete backup system. I am 
> interested in developing an addition to the existing system. I would 
> like to develop a command line client for windows that will directly 
> access a backup
> stored on disc/CD/DVD. i.e.. A copy of the Server directory for the
> username.
>
> Is there any information that you could provide to assist in this
> process.
> i.e.. pseudo code on accessing the file structures Directly?

There is plenty of actual code to look at! And some overview docs in 
the notes directory.

The relevant code is in lib/backupstore and lib/backupclient. You can 
easily create a new executable which includes these bits of code, look 
in the modules.txt file.

Look in StoreStructure.h for functions to generate local filenames from 
object IDs. Start by loading the root directory with ID 
BACKUPSTORE_ROOT_DIRECTORY_ID as a BackupStoreDirectory (Use the 
filename with a RaidFileRead stream, then use 
BackupStoreDirectory::ReadFromStream() to load up the contents.) Then 
go through the entries with a BackupStoreDirectory::Iterator, and 
examine them. Recurse to other directories. To restore a file, use 
BackupStoreFile::DecodeFile().

To set up the crypto so dirs and files can be decoded properly, use 
BackupClientCryptoKeys_Setup(), given the keys file used to create the 
data. To be able to use the RaidFile stuff, call 
RaidFileController::GetController().Initialise() with the path to a 
suitable configuration file, which you'll probably have to generate on 
the fly given the location of the data on the CD.

There are some tests which show these principles. The tests are not 
written to the same quality standards as the rest of the code. 
test/backupstore is worth a look, even if most of the code communicates 
with the server. (But bear in mind that the structures are all the 
same, just downloaded from the server rather than loaded from the 
disc.)

Finally, ask Nick for a copy of the source for the Win32 port, which 
will make it easier to work under Windows. The RaidFile stuff won't 
have been ported, and indeed some of it might not be possible given 
that the write side of things relies on the way UNIX filesystems work. 
But you should be able to get the RaidFileRead stuff to work. 
Alternatively, if your server doesn't use the RaidFile in RAID mode (ie 
just one disc in each set, not three) simply append ".rfw" and prepend 
the root of the "RAID" files to the names given by the StoreStructure 
utilities, and use a FileStream object instead. It'd be better to use 
the proper interface, but you may have no choice under Win32. Maybe you 
could use a special function to open the files, and later it could be 
replaced by one which used the RaidFile interface properly?

I'm curious, why do you want this tool?

Ben


_______________________________________________
boxbackup mailing list
boxbackup@fluffy.co.uk
http://lists.warhead.org.uk/mailman/listinfo/boxbackup