/// <summary> /// Converts a passed FileItem into a file information structure. Exceptions can be thrown. /// </summary> /// <param name="FuserFileItem"></param> /// <returns></returns> public static void convertFileInformation(IFuserFilesystemItem vItem, FuserFileInformation overwriteFileInfo) { lock (vItem) { overwriteFileInfo.Filename = vItem.Name; overwriteFileInfo.CreationTime = vItem.CreationTime; overwriteFileInfo.LastAccessTime = vItem.LastAccessTime; overwriteFileInfo.LastWriteTime = vItem.LastWriteTime; overwriteFileInfo.Attributes = 0; if (vItem.isArchive) { overwriteFileInfo.Attributes |= FileAttributes.Archive; } if (vItem.isReadOnly) { overwriteFileInfo.Attributes |= FileAttributes.ReadOnly; } if (vItem.isHidden) { overwriteFileInfo.Attributes |= FileAttributes.Hidden; } if (vItem.isSystem) { overwriteFileInfo.Attributes |= FileAttributes.System; } if (vItem is IFuserFilesystemDirectory) { overwriteFileInfo.Attributes |= FileAttributes.Directory; overwriteFileInfo.Length = 0; } else { if (overwriteFileInfo.Attributes == 0) { overwriteFileInfo.Attributes = FileAttributes.Normal; } IFuserFilesystemFile file = (IFuserFilesystemFile)vItem; overwriteFileInfo.Length = file.Length; } } }