OpenedPathInfo Class
Contains information about an opened file or directory.
|
See Also
Thread Safety
Remarks
Members
See Also: Inherited members from object.
Properties
|
DirectIO
|
bool . Indicates whether or not direct I/O can be used on this file. |
|
Handle
|
IntPtr . Handle to an open file or directory. |
|
KeepCache
|
bool . Indicates that cached file data should not be invalidated. |
| OpenAccess [read-only] | Mono.Unix.Native.OpenFlags . Gets a Mono.Unix.Native.OpenFlags instance containing a specification for how the resource (file or directory) should be accessed. |
|
OpenFlags
|
Mono.Unix.Native.OpenFlags . Gets a Mono.Unix.Native.OpenFlags instance containing a specification for how the resource (file or directory) should be opened. |
|
WritePage
|
int . Indicates if a write operation was caused by a writepage. |
Member Details
OpenFlags Property
Gets a Mono.Unix.Native.OpenFlags instance containing a specification for how the resource (file or directory) should be opened.
See Also
Value
Remarks
The Mono.Unix.Native.OpenFlags value contains two sets of information:
- How the file should be opened, (e.g. read-only, read/write).
- Miscellaneous information, (open exclusively, truncate on open, open for appending, large file support, etc.).
The OpenedPathInfo.OpenAccess property returns the first piece of information as a convenience property so that no bitwise masking is required to determine how the file should be opened.
OpenAccess Property
Gets a Mono.Unix.Native.OpenFlags instance containing a specification for how the resource (file or directory) should be accessed.
See Also
Value
Remarks
This property returns OpenedPathInfo.OpenFlags value masked so that it will only return one of:
| Value | Description |
|---|---|
| Mono.Unix.Native.OpenFlags.O_RDONLY | The file or directory should be opened read-only. |
| Mono.Unix.Native.OpenFlags.O_RDWR | The file or directory should be opened read-write. |
| Mono.Unix.Native.OpenFlags.O_WRONLY | The file or directory should be opened write-only. |
WritePage Property
Indicates if a write operation was caused by a writepage.
Value
Remarks
Should this be a bool?.
TODO: What is a writepage operation?
DirectIO Property
Indicates whether or not direct I/O can be used on this file.
See Also
Value
Remarks
KeepCache Property
Indicates that cached file data should not be invalidated.
See Also
Value
Remarks
Handle Property
Handle to an open file or directory.
See Also
Value
Remarks
This can be set in an open operation (FileSystem.OnCreateHandle, FileSystem.OnOpenHandle, FileSystem.OnOpenDirectory) so that its value is available from the other related operations (FileSystem.OnReadDirectory, FileSystem.OnReadHandle, FileSystem.OnWriteHandle, etc.).
If set in an open operation, then the underlying resource should be released in the appropriate corresponding close operation (FileSystem.OnReleaseDirectory, FileSystem.OnReleaseHandle).
This does not need to be set to support reading and writing. For example, if FileSystem.OnOpenHandle is not overridden, a file can still be "opened" for reading & writing as long as the Mono.Unix.Native.Stat.st_mode instance filled in by FileSystem.OnGetPathStatus permits reading or writing. In this case, if e.g. FileSystem.OnReadHandle is overridden then it will be invoked with a OpenedPathInfo.Handle value of IntPtr.Zero.
It is recommended that this property be used, so that if a file or directory is renamed (FileSystem.OnRenamePath) while a file is open the reading program won't notice and get "bizarre" data.