public static GetDirectoryReference ( Microsoft.WindowsAzure.Storage.File.CloudFileDirectory parent, string path ) : Microsoft.WindowsAzure.Storage.File.CloudFileDirectory | ||
parent | Microsoft.WindowsAzure.Storage.File.CloudFileDirectory | |
path | string | |
return | Microsoft.WindowsAzure.Storage.File.CloudFileDirectory |
public int CreateDirectory(string filename, DokanFileInfo info) { Trace.WriteLine(string.Format("CreateDirectory {0}", filename)); var dirRef = Extensions.GetDirectoryReference(root, filename.ToFileString()); dirRef.CreateIfNotExists(); return(0); }
public int GetFileInformation(string filename, FileInformation fileinfo, DokanFileInfo info) { Trace.WriteLine(string.Format("GetFileInformation {0}", filename)); if (filename == @"\") { fileinfo.Attributes = FileAttributes.Directory; fileinfo.LastAccessTime = DateTime.Now; fileinfo.LastWriteTime = DateTime.Now; fileinfo.CreationTime = DateTime.Now; return(0); } var fileRef = Extensions.GetFileReference(root, filename.ToFileString()); if (fileRef.Exists()) { fileinfo.Length = fileRef.Properties.Length; fileinfo.LastAccessTime = fileRef.Properties.LastModified.Value.LocalDateTime; fileinfo.LastWriteTime = fileRef.Properties.LastModified.Value.LocalDateTime; fileinfo.CreationTime = fileRef.Properties.LastModified.Value.LocalDateTime; fileinfo.Attributes = FileAttributes.Normal; fileinfo.FileName = fileRef.Name; return(0); } else { var dirRef = Extensions.GetDirectoryReference(root, filename.ToFileString()); if (dirRef.Exists()) { fileinfo.Attributes = FileAttributes.Directory; fileinfo.LastAccessTime = DateTime.Now; fileinfo.LastWriteTime = DateTime.Now; fileinfo.CreationTime = DateTime.Now; fileinfo.FileName = filename; return(0); } } return(-DokanNet.ERROR_FILE_NOT_FOUND); }
public int FindFiles(string filename, System.Collections.ArrayList files, DokanFileInfo info) { Trace.WriteLine(string.Format("FindFiles {0}", filename)); var cloudDirectory = root; if (filename != @"\") { cloudDirectory = Extensions.GetDirectoryReference(root, filename.ToFileString()); } var output = cloudDirectory.ListFilesAndDirectories(); foreach (var item in output) { if (item is CloudFile) { files.Add((item as CloudFile).ToFileInformation()); } else if (item is CloudFileDirectory) { files.Add((item as CloudFileDirectory).ToFileInformation()); } } return(0); }