public void Do_Backup() { Init_Volume(); _LastJournal = Vol.Refresh(); Vol.Map_Volume(); Vol.Update(_LastJournal); var r = Vol.GetDirectory(SourcePath); if(r != null) { var dst = DestnationPath + "\\test_" + Increment.ToString(); var src = ""; if(Increment == 0) { src = dst; } else { src = DestnationPath + "\\test_" + (Increment - 1).ToString(); } r.CopyTo(dst, src); } Increment += 1; }
public Win32Api.USN_JOURNAL_DATA Refresh() { var old = _Current_JournalState; _Current_JournalState = new Win32Api.USN_JOURNAL_DATA(); NTFS_Volume.NTFS_Functions.QueryUsnJournal(_Root_Handle, ref _Current_JournalState);//need to query the jounral to get the first usn number return(old); }
public NTFSVolume(string drive, Win32Api.USN_JOURNAL_DATA lastusn) { var rootpath = new DriveInfo(drive); _Root_Handle = NTFS_Volume.NTFS_Functions.GetRootHandle(rootpath); _Root = new Volume.NTFS_File(new Win32Api.UsnEntry(rootpath.Name.Replace("\\", ""))); Lookup = new Dictionary<ulong, Journal.Volume.NTFS_File>(); _Current_JournalState = lastusn; }
public NTFSVolume(string drive, Win32Api.USN_JOURNAL_DATA lastusn) { var rootpath = new DriveInfo(drive); _Root_Handle = NTFS_Volume.NTFS_Functions.GetRootHandle(rootpath); _Root = new Volume.NTFS_File(new Win32Api.UsnEntry(rootpath.Name.Replace("\\", ""))); Lookup = new Dictionary <ulong, Journal.Volume.NTFS_File>(); _Current_JournalState = lastusn; }
public NTFSVolume(string drive) { var rootpath = new DriveInfo(drive); _Root_Handle = NTFS_Volume.NTFS_Functions.GetRootHandle(rootpath); _Root = new Volume.NTFS_File(new Win32Api.UsnEntry(rootpath.Name.Replace("\\", ""))); _Current_JournalState = new Win32Api.USN_JOURNAL_DATA(); Lookup = new Dictionary<ulong, Journal.Volume.NTFS_File>(); NTFS_Volume.NTFS_Functions.QueryUsnJournal(_Root_Handle, ref _Current_JournalState);//need to query the jounral to get the first usn number }
public NTFSVolume(string drive) { var rootpath = new DriveInfo(drive); _Root_Handle = NTFS_Volume.NTFS_Functions.GetRootHandle(rootpath); _Root = new Volume.NTFS_File(new Win32Api.UsnEntry(rootpath.Name.Replace("\\", ""))); _Current_JournalState = new Win32Api.USN_JOURNAL_DATA(); Lookup = new Dictionary <ulong, Journal.Volume.NTFS_File>(); NTFS_Volume.NTFS_Functions.QueryUsnJournal(_Root_Handle, ref _Current_JournalState);//need to query the jounral to get the first usn number }
public List <Journal.Volume.NTFS_File> Update(Win32Api.USN_JOURNAL_DATA last) { var files = new List <Journal.Volume.NTFS_File>(); var changes = NTFS_Volume.NTFS_Functions.Get_Changes(_Root_Handle, last); foreach (var item in changes) { Journal.Volume.NTFS_File found = null; Lookup.TryGetValue(item.FileReferenceNumber, out found); if (found != null) { Update((Journal.Volume.NTFS_File)found, item); } } return(files); }
public Win32Api.USN_JOURNAL_DATA Refresh() { var old = _Current_JournalState; _Current_JournalState = new Win32Api.USN_JOURNAL_DATA(); NTFS_Volume.NTFS_Functions.QueryUsnJournal(_Root_Handle, ref _Current_JournalState);//need to query the jounral to get the first usn number return old; }