Mono.Fuse : Mono.Fuse Namespace

OpenedPathInfo Class

Contains information about an opened file or directory.

public sealed class OpenedPathInfo


See Also

Thread Safety

All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.

Remarks

The Mono.Fuse.OpenedPathInfo class provides information about a request to open a file or directory, and information for using an opened file or directory.

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

public Mono.Unix.Native.OpenFlags OpenFlags { set; get; }

Gets a Mono.Unix.Native.OpenFlags instance containing a specification for how the resource (file or directory) should be opened.

See Also

Value

A Mono.Unix.Native.OpenFlags instance containing a specification for how the resource (file or directory) should be opened or was opened.

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

public Mono.Unix.Native.OpenFlags OpenAccess { get; }

Gets a Mono.Unix.Native.OpenFlags instance containing a specification for how the resource (file or directory) should be accessed.

See Also

Value

A Mono.Unix.Native.OpenFlags instance containing a specification for how the resource (file or directory) should be accessed or was opened.

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

public int WritePage { set; get; }

Indicates if a write operation was caused by a writepage.

Value

A int indicating if this write operation was caused by a writepage operation.

Remarks

Should this be a bool?.

TODO: What is a writepage operation?


DirectIO Property

public bool DirectIO { set; get; }

Indicates whether or not direct I/O can be used on this file.

See Also

Value

A bool indicating whether or not direct I/O can be used on this file.

Remarks

This should only be changed by FileSystem.OnCreateHandle or FileSystem.OnOpenHandle.

KeepCache Property

public bool KeepCache { set; get; }

Indicates that cached file data should not be invalidated.

See Also

Value

A bool indicating that cached file data need not be invalidated.

Remarks

This should only be changed by FileSystem.OnCreateHandle or FileSystem.OnOpenHandle.

Handle Property

public IntPtr Handle { set; get; }

Handle to an open file or directory.

See Also

Value

A IntPtr containing a handle to an open file or directory.

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.