public int MoveFile(string filename, string newname, bool replace, DokanFileInfo info) { CacheEntry entry = cache_.Lookup(filename); entry.RemoveAllCache(); entry.Parrent.RemoveFindFilesCache(); entry = cache_.Lookup(newname); entry.RemoveAllCache(); entry.Parrent.RemoveFindFilesCache(); return(ope_.MoveFile(filename, newname, replace, info)); }
public int DeleteDirectory(string filename, DokanFileInfo info) { CacheEntry entry = cache_.Lookup(filename); entry.RemoveAllCache(); entry.Parrent.RemoveFindFilesCache(); return(ope_.DeleteDirectory(filename, info)); }
public NtStatus DeleteFile(string filename, DokanFileInfo info) { CacheEntry entry = cache_.Lookup(filename); entry.RemoveAllCache(); entry.Parrent.RemoveFindFilesCache(); return(ope_.DeleteFile(filename, info)); }
public NtStatus CreateFile(string filename, DokanNet.FileAccess access, FileShare share, FileMode mode, FileOptions options, FileAttributes attributes, DokanFileInfo info) { NtStatus ret = NtStatus.Success; if (filename.EndsWith(":SSHFSProperty.Cache")) { System.Diagnostics.Debug.WriteLine("SSHFS.Cache: " + filename); filename = filename.Remove(filename.IndexOf(":SSHFSProperty.Cache")); CacheEntry entry = cache_.Lookup(filename); entry.RemoveAllCache(); return(NtStatus.Success); } if (mode == FileMode.Open || mode == FileMode.OpenOrCreate) { CacheEntry entry = cache_.Lookup(filename); if (mode == FileMode.OpenOrCreate) { if (entry.Parrent != null) { entry.Parrent.RemoveFindFilesCache(); } } if (entry.CreateFileRet == NtStatus.MaximumNtStatus) { ret = ope_.CreateFile(filename, access, share, mode, options, attributes, info); entry.CreateFileRet = ret; } else { ret = entry.CreateFileRet; } } else { ret = ope_.CreateFile(filename, access, share, mode, options, attributes, info); if (mode == FileMode.Create || mode == FileMode.CreateNew) { CacheEntry entry = cache_.Lookup(filename); if (entry.Parrent != null) { entry.Parrent.RemoveFindFilesCache(); } } } return(ret); }
public int Unmount(DokanFileInfo info) { cache_.RemoveAllCache(); return(ope_.Unmount(info)); }
public NtStatus Mounted(DokanFileInfo info) { cache_.RemoveAllCache(); return(ope_.Mounted(info)); }