Mono Class Library: Mono.Unix NamespaceMono.Unix.UnixFileSystemInfo Class |
See Also: UnixFileSystemInfo Members
|
All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.
The Mono.Unix.UnixFileSystemInfo class provides information about a file system entry and permits file system entry manipulation such as:
- Determining the full file name with UnixFileSystemInfo.FullName.
- Determining whether the file exists with UnixFileSystemInfo.Exists
- Querying file system entry metadata such as the hardware device it resides on (UnixFileSystemInfo.Device), the file system inode (UnixFileSystemInfo.Inode), file access permissions (UnixFileSystemInfo.FileAccessPermissions), file type (UnixFileSystemInfo.FileType), file owner information (UnixFileSystemInfo.OwnerUser), group information (UnixFileSystemInfo.OwnerGroup), file size (UnixFileSystemInfo.Length), various times maintained by the operating system (UnixFileSystemInfo.LastAccessTime, UnixFileSystemInfo.LastWriteTime, UnixFileSystemInfo.LastStatusChangeTime), and more.
- Creating hard links with UnixFileSystemInfo.CreateLink.
- Creating symbolic links with UnixFileSystemInfo.CreateSymbolicLink.
- File system entry deletion with UnixFileSystemInfo.Delete.
- Setting file system owner and group information with UnixFileSystemInfo.SetOwner.
Information provided by this type may not be valid for any significant period of time, due to potential race conditions with other processes running on the system or because of file management actions performed within the current process.
The only guarantee is that the information provided was valid at some point in time, or an InvalidOperationException exception will be thrown when attempting to access the provided information.
Note: To clarify, once the file system entry UnixFileSystemInfo.FullName is found, it won't be checked for again until a call to UnixFileSystemInfo.Refresh. FullName will be checked for during object construction, but need not exist during object construction -- UnixFileSystemInfo.Exists will let you know if the file currently exists and does an implicit Refresh. If FullName doesn't exist when the UnixFileSystemInfo is created, it will be checked for whenever information about the file system entry is required, such as with UnixFileSystemInfo.Device and UnixFileSystemInfo.Length.Check the individual method and property documentation to determine if and when an exception will be thrown.
[Edit]
Namespace: Mono.Unix
Assembly: Mono.Posix (in Mono.Posix.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0