summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/backupstore/BackupCommands.cpp22
-rw-r--r--lib/backupstore/BackupStoreContext.cpp11
-rw-r--r--lib/backupstore/BackupStoreContext.h7
-rw-r--r--lib/backupstore/backupprotocol.txt9
4 files changed, 45 insertions, 4 deletions
diff --git a/lib/backupstore/BackupCommands.cpp b/lib/backupstore/BackupCommands.cpp
index 471ed56a..468b2253 100644
--- a/lib/backupstore/BackupCommands.cpp
+++ b/lib/backupstore/BackupCommands.cpp
@@ -468,7 +468,27 @@ std::auto_ptr<BackupProtocolMessage> BackupProtocolGetFile::DoCommand(BackupProt
// Created: 2003/09/04
//
// --------------------------------------------------------------------------
-std::auto_ptr<BackupProtocolMessage> BackupProtocolCreateDirectory::DoCommand(BackupProtocolReplyable &rProtocol, BackupStoreContext &rContext) const
+std::auto_ptr<BackupProtocolMessage> BackupProtocolCreateDirectory::DoCommand(
+ BackupProtocolReplyable &rProtocol, BackupStoreContext &rContext) const
+{
+ return BackupProtocolCreateDirectory2(mContainingDirectoryID,
+ mAttributesModTime, 0 /* ModificationTime */,
+ mDirectoryName).DoCommand(rProtocol, rContext);
+}
+
+
+
+// --------------------------------------------------------------------------
+//
+// Function
+// Name: BackupProtocolCreateDirectory2::DoCommand(Protocol &, BackupStoreContext &)
+// Purpose: Create directory command, with a specific
+// modification time.
+// Created: 2014/02/11
+//
+// --------------------------------------------------------------------------
+std::auto_ptr<BackupProtocolMessage> BackupProtocolCreateDirectory2::DoCommand(
+ BackupProtocolReplyable &rProtocol, BackupStoreContext &rContext) const
{
CHECK_PHASE(Phase_Commands)
CHECK_WRITEABLE_SESSION
diff --git a/lib/backupstore/BackupStoreContext.cpp b/lib/backupstore/BackupStoreContext.cpp
index 771bc960..07618625 100644
--- a/lib/backupstore/BackupStoreContext.cpp
+++ b/lib/backupstore/BackupStoreContext.cpp
@@ -1026,7 +1026,12 @@ void BackupStoreContext::SaveDirectory(BackupStoreDirectory &rDir, int64_t Objec
// Created: 2003/09/04
//
// --------------------------------------------------------------------------
-int64_t BackupStoreContext::AddDirectory(int64_t InDirectory, const BackupStoreFilename &rFilename, const StreamableMemBlock &Attributes, int64_t AttributesModTime, bool &rAlreadyExists)
+int64_t BackupStoreContext::AddDirectory(int64_t InDirectory,
+ const BackupStoreFilename &rFilename,
+ const StreamableMemBlock &Attributes,
+ int64_t AttributesModTime,
+ int64_t ModificationTime,
+ bool &rAlreadyExists)
{
if(mapStoreInfo.get() == 0)
{
@@ -1102,7 +1107,9 @@ int64_t BackupStoreContext::AddDirectory(int64_t InDirectory, const BackupStoreF
// Then add it into the parent directory
try
{
- dir.AddEntry(rFilename, 0 /* modification time */, id, 0 /* blocks used */, BackupStoreDirectory::Entry::Flags_Dir, 0 /* attributes mod time */);
+ dir.AddEntry(rFilename, ModificationTime, id, dirSize,
+ BackupStoreDirectory::Entry::Flags_Dir,
+ AttributesModTime);
SaveDirectory(dir, InDirectory);
// Increment reference count on the new directory to one
diff --git a/lib/backupstore/BackupStoreContext.h b/lib/backupstore/BackupStoreContext.h
index e0162636..62b828df 100644
--- a/lib/backupstore/BackupStoreContext.h
+++ b/lib/backupstore/BackupStoreContext.h
@@ -141,7 +141,12 @@ public:
// Manipulating files/directories
int64_t AddFile(IOStream &rFile, int64_t InDirectory, int64_t ModificationTime, int64_t AttributesHash, int64_t DiffFromFileID, const BackupStoreFilename &rFilename, bool MarkFileWithSameNameAsOldVersions);
- int64_t AddDirectory(int64_t InDirectory, const BackupStoreFilename &rFilename, const StreamableMemBlock &Attributes, int64_t AttributesModTime, bool &rAlreadyExists);
+ int64_t AddDirectory(int64_t InDirectory,
+ const BackupStoreFilename &rFilename,
+ const StreamableMemBlock &Attributes,
+ int64_t AttributesModTime,
+ int64_t ModificationTime,
+ bool &rAlreadyExists);
void ChangeDirAttributes(int64_t Directory, const StreamableMemBlock &Attributes, int64_t AttributesModTime);
bool ChangeFileAttributes(const BackupStoreFilename &rFilename, int64_t InDirectory, const StreamableMemBlock &Attributes, int64_t AttributesHash, int64_t &rObjectIDOut);
bool DeleteFile(const BackupStoreFilename &rFilename, int64_t InDirectory, int64_t &rObjectIDOut);
diff --git a/lib/backupstore/backupprotocol.txt b/lib/backupstore/backupprotocol.txt
index 24dd2e44..be037313 100644
--- a/lib/backupstore/backupprotocol.txt
+++ b/lib/backupstore/backupprotocol.txt
@@ -124,6 +124,14 @@ CreateDirectory 20 Command(Success) StreamWithCommand
# stream following containing attributes
+CreateDirectory2 46 Command(Success) StreamWithCommand
+ int64 ContainingDirectoryID
+ int64 AttributesModTime
+ int64 ModificationTime
+ Filename DirectoryName
+ # stream following containing attributes
+
+
ListDirectory 21 Command(Success)
int64 ObjectID
int16 FlagsMustBeSet
@@ -255,3 +263,4 @@ AccountUsage2 45 Reply
int64 NumDeletedFiles
int64 NumDirectories
+# 46 is CreateDirectory2