diff options
| author | Michael <[email protected]> | 2017-04-22 08:54:38 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-04-22 08:54:38 -0400 |
| commit | 114141b56e02857fa749cc130f16a2d6cc4c35f5 (patch) | |
| tree | 711c08594ef4baaac47e334cba4522bf35badb8e /ShiftOS_TheReturn/Paths.cs | |
| parent | 45b290efd9a907456b7d3bfa44e9f730dc8cd703 (diff) | |
| download | shiftos_thereturn-114141b56e02857fa749cc130f16a2d6cc4c35f5.tar.gz shiftos_thereturn-114141b56e02857fa749cc130f16a2d6cc4c35f5.tar.bz2 shiftos_thereturn-114141b56e02857fa749cc130f16a2d6cc4c35f5.zip | |
Add FS delete functions
Diffstat (limited to 'ShiftOS_TheReturn/Paths.cs')
| -rw-r--r-- | ShiftOS_TheReturn/Paths.cs | 46 |
1 files changed, 31 insertions, 15 deletions
diff --git a/ShiftOS_TheReturn/Paths.cs b/ShiftOS_TheReturn/Paths.cs index e756da7..a84271b 100644 --- a/ShiftOS_TheReturn/Paths.cs +++ b/ShiftOS_TheReturn/Paths.cs @@ -135,41 +135,57 @@ namespace ShiftOS.Engine //This event-based system allows us to sync the ramdisk from ShiftOS to the host OS. Utils.DirectoryCreated += (dir) => { - if (dir.StartsWith("1:/")) + try { - string real = dir.Replace("/", "\\").Replace("1:", SharedFolder); - if (!System.IO.Directory.Exists(real)) - System.IO.Directory.CreateDirectory(real); + if (dir.StartsWith("1:/")) + { + string real = dir.Replace("/", "\\").Replace("1:", SharedFolder); + if (!System.IO.Directory.Exists(real)) + System.IO.Directory.CreateDirectory(real); + } } + catch { } }; Utils.DirectoryDeleted += (dir) => { - if (dir.StartsWith("1:/")) + try { - string real = dir.Replace("/", "\\").Replace("1:", SharedFolder); - if (System.IO.Directory.Exists(real)) - System.IO.Directory.Delete(real, true); + if (dir.StartsWith("1:/")) + { + string real = dir.Replace("/", "\\").Replace("1:", SharedFolder); + if (System.IO.Directory.Exists(real)) + System.IO.Directory.Delete(real, true); + } } + catch { } }; Utils.FileWritten += (dir) => { - if (dir.StartsWith("1:/")) + try { - string real = dir.Replace("/", "\\").Replace("1:", SharedFolder); - System.IO.File.WriteAllBytes(real, ReadAllBytes(dir)); + if (dir.StartsWith("1:/")) + { + string real = dir.Replace("/", "\\").Replace("1:", SharedFolder); + System.IO.File.WriteAllBytes(real, ReadAllBytes(dir)); + } } + catch { } }; Utils.FileDeleted += (dir) => { - if (dir.StartsWith("1:/")) + try { - string real = dir.Replace("/", "\\").Replace("1:", SharedFolder); - if (System.IO.File.Exists(real)) - System.IO.File.Delete(real); + if (dir.StartsWith("1:/")) + { + string real = dir.Replace("/", "\\").Replace("1:", SharedFolder); + if (System.IO.File.Exists(real)) + System.IO.File.Delete(real); + } } + catch { } }; //This thread will sync the ramdisk from the host OS to ShiftOS. |
