// // Copyright (c) 2008-2011, Kenneth Bell // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. // namespace DiscUtils { using System.Security.AccessControl; /// /// Provides the base class for all file systems that support Windows semantics. /// public interface IWindowsFileSystem : IFileSystem { /// /// Gets the security descriptor associated with the file or directory. /// /// The file or directory to inspect. /// The security descriptor. RawSecurityDescriptor GetSecurity(string path); /// /// Sets the security descriptor associated with the file or directory. /// /// The file or directory to change. /// The new security descriptor. void SetSecurity(string path, RawSecurityDescriptor securityDescriptor); /// /// Gets the reparse point data associated with a file or directory. /// /// The file to query. /// The reparse point information. ReparsePoint GetReparsePoint(string path); /// /// Sets the reparse point data on a file or directory. /// /// The file to set the reparse point on. /// The new reparse point. void SetReparsePoint(string path, ReparsePoint reparsePoint); /// /// Removes a reparse point from a file or directory, without deleting the file or directory. /// /// The path to the file or directory to remove the reparse point from. void RemoveReparsePoint(string path); /// /// Gets the short name for a given path. /// /// The path to convert. /// The short name. /// /// This method only gets the short name for the final part of the path, to /// convert a complete path, call this method repeatedly, once for each path /// segment. If there is no short name for the given path,null is /// returned. /// string GetShortName(string path); /// /// Sets the short name for a given file or directory. /// /// The full path to the file or directory to change. /// The shortName, which should not include a path. void SetShortName(string path, string shortName); /// /// Gets the standard file information for a file. /// /// The full path to the file or directory to query. /// The standard file information. WindowsFileInformation GetFileStandardInformation(string path); /// /// Sets the standard file information for a file. /// /// The full path to the file or directory to query. /// The standard file information. void SetFileStandardInformation(string path, WindowsFileInformation info); /// /// Gets the names of the alternate data streams for a file. /// /// The path to the file. /// /// The list of alternate data streams (or empty, if none). To access the contents /// of the alternate streams, use OpenFile(path + ":" + name, ...). /// string[] GetAlternateDataStreams(string path); /// /// Gets the file id for a given path. /// /// The path to get the id of. /// The file id, or -1. /// /// The returned file id uniquely identifies the file, and is shared by all hard /// links to the same file. The value -1 indicates no unique identifier is /// available, and so it can be assumed the file has no hard links. /// long GetFileId(string path); /// /// Indicates whether the file is known by other names. /// /// The file to inspect. /// true if the file has other names, else false. bool HasHardLinks(string path); } }