Mono.Fuse : Mono.Fuse Namespace

FileSystem Class

Interface to the Linux File System in User Space (FUSE) Library.

public abstract class FileSystem : IDisposable

Thread Safety

This type is safe for multithreaded operations.

Remarks

The Mono.Fuse.FileSystem type facilitates the implementation of FUSE file system programs. Subclasses can override the FileSystem methods to subscribe and respond to file system events, allowing any other program to communicate with the FileSystem subclass as if it were a file system.

Overridable methods correspond to the following categories:

Note to Inheritors

Inherited classes must be thread-safe by default. If the inherited class cannot be thread safe, then the FileSystem.MultiThreaded property should be set to false, or the -s program argument should be passed to FileSystem.ParseFuseArguments or the FileSystem(String[]) constructor.

Not all methods need to be overridden. If a method isn't overridden, then Mono.Unix.Native.Errno.ENOSYS will be returned to the calling program, and nothing will happen when that operation is requested. For example, if you don't override FileSystem.OnCreateDirectory, then if a program attempts to call Mono.Unix.Native.Syscall.mkdir (e.g. through the mkdir(1) program) it will get an error, and the operation will not continue.

Some methods need to be implemented in sets, or a InvalidOperationException will be generated from FileSystem.Start. These sets are:

Example

The following sample file system will return the contents of SimpleFS.names when the directory is read.

C# Example
using System;
using System.Collections.Generic;
using Mono.Fuse;
using Mono.Unix.Native;

class SimpleFS : FileSystem {
  private List<string> names = new List<string> ();

  public SimpleFS (string[] args) : base (args)
  {
    names.Add ("/foo");
    names.Add ("/bar");
    names.Add ("/baz");
  }

  protected override Errno OnReadDirectory (string directory, OpenedPathInfo info,
      out IEnumerable<DirectoryEntry> names)
  {
    if (directory != "/") {
      names = null;
      return Errno.ENOENT;
    }
    names = ListNames (directory);
    return 0;
  }

  private IEnumerable<DirectoryEntry> ListNames (string directory)
  {
    foreach (string name in names) {
      yield return new DirectoryEntry (name.Substring (1));
    }
  }

  protected override Errno OnGetPathStatus (string path, ref Stat stbuf)
  {
    stbuf = new Stat ();
    if (path == "/") {
      stbuf.st_mode  = NativeConvert.FromUnixPermissionString ("dr-xr-xr-x");
      stbuf.st_nlink = 1;
      return 0;
    }
    if (!names.Contains (path))
      return Errno.ENOENT;
    stbuf.st_mode = NativeConvert.FromUnixPermissionString ("-r--r--r--");
    return 0;
  }

  public static void Main (string[] args)
  {
    using (SimpleFS fs = new SimpleFS (args)) {
      fs.Start ();
    }
  }
}

The above program can be compiled as:

sh Example
gmcs -r:Mono.Fuse.dll -r:Mono.Posix.dll SimpleFS.cs

The resulting program can then be used by executing it and using normal shell programs to interact with it.

sh Example
$ mono SimpleFS.exe mountpoint &
$ ls -1 mountpoint
bar
baz
foo

The program can be terminated by unmounting mountpoint by using the fusermount program:

sh Example
fusermount -u mountpoint

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)
Assembly Versions: 0.0.0.0

Members

See Also: Inherited members from object.

Protected Constructors

Creates and initializes a new instance of the Mono.Fuse.FileSystem class.
Creates and initializes a new instance of the Mono.Fuse.FileSystem class for the specified mount point.
Creates and initializes a new instance of the Mono.Fuse.FileSystem class using the specified arguments.

Public Properties

AllowAccessToOthers bool . Allow access to other users.
AllowAccessToRoot bool . Allow access to other users.
AllowMountOverNonEmptyDirectory bool . Allow mounting over a non-empty directory.
AttributeTimeout double . Cache timeout for attributes.
DefaultGroupId long . Default file owner Group ID.
DefaultUmask Mono.Unix.Native.FilePermissions . Default file umask.
DefaultUserId long . Default file owner User ID.
DeletedPathTimeout double . Cache timeout for deleted path names.
EnableDirectIO bool . Enable Direct I/O.
EnableFuseDebugOutput bool . Enable generation of FUSE debug messages to the standard output stream.
EnableKernelCache bool . Cache files in kernel.
EnableKernelPermissionChecking bool . Enable permission checking by the OS kernel.
EnableLargeReadRequests bool . Issue large read requests.
[read-only]
FuseOptions IDictionary<string, string> . FUSE startup options.
ImmediatePathRemoval bool . Immediately remove file and directories, don't hide them.
MaxReadSize int . Gets or sets the maximum size of read requests.
MountPoint string . The directory to mount the file system over.
MultiThreaded bool . Controls whether FUSE will invoke Mono.Fuse.FileSystem methods in a multithreaded manner.
Name string . Gets or sets the file system name.
PathTimeout double . Cache timeout for path names.
ReaddirSetsInode bool . Readdir sets inodes.
SetsInodes bool . FileSystem sets inode numbers.

Public Methods

Dispose ()
Cleans up FUSE resources.
ParseFuseArguments (string[]) : string[]
Parses args looking for FUSE options.
static
ShowFuseHelp (string)
Writes FUSE argument information to your programs standard error stream.
Start ()
Initializes FUSE and starts file system event processing.
Stop ()
Exits the FUSE event loop.

Protected Methods

Dispose (bool)
Release resources associated with this instance.
static
GetOperationContext () : FileSystemOperationContext
Gets a Mono.Fuse.FileSystemOperationContext instance containing additional contextual information for the current operation.
OnAccessPath (string, Mono.Unix.Native.AccessModes) : Mono.Unix.Native.Errno
Check file access permissions.
OnChangePathOwner (string, long, long) : Mono.Unix.Native.Errno
Change owner and group of a file.
OnChangePathPermissions (string, Mono.Unix.Native.FilePermissions) : Mono.Unix.Native.Errno
Change the permission bits of a file.
OnChangePathTimes (string, ref Mono.Unix.Native.Utimbuf) : Mono.Unix.Native.Errno
Set file access and modification times.
OnCreateDirectory (string, Mono.Unix.Native.FilePermissions) : Mono.Unix.Native.Errno
Create a directory.
OnCreateHandle (string, OpenedPathInfo, Mono.Unix.Native.FilePermissions) : Mono.Unix.Native.Errno
Create and open a file.
OnCreateHardLink (string, string) : Mono.Unix.Native.Errno
Create a hard link to a file.
OnCreateSpecialFile (string, Mono.Unix.Native.FilePermissions, ulong) : Mono.Unix.Native.Errno
Create a special or ordinary file.
OnCreateSymbolicLink (string, string) : Mono.Unix.Native.Errno
Create a symbolic link.
OnFlushHandle (string, OpenedPathInfo) : Mono.Unix.Native.Errno
Possibly flush cached data.
OnGetFileSystemStatus (string, out Mono.Unix.Native.Statvfs) : Mono.Unix.Native.Errno
Get file system statistics.
OnGetHandleStatus (string, OpenedPathInfo, out Mono.Unix.Native.Stat) : Mono.Unix.Native.Errno
Get attributes of an open file.
OnGetPathExtendedAttribute (string, string, byte[], out int) : Mono.Unix.Native.Errno
Retreive an extended attribute value.
OnGetPathStatus (string, out Mono.Unix.Native.Stat) : Mono.Unix.Native.Errno
Get file or directory attributes.
OnListPathExtendedAttributes (string, out string[]) : Mono.Unix.Native.Errno
List extended attribute names.
OnOpenDirectory (string, OpenedPathInfo) : Mono.Unix.Native.Errno
Open a directory for later reading.
OnOpenHandle (string, OpenedPathInfo) : Mono.Unix.Native.Errno
Open or create a file for reading or writing.
OnReadDirectory (string, OpenedPathInfo, out IEnumerable<DirectoryEntry>) : Mono.Unix.Native.Errno
Read the files in a directory.
OnReadHandle (string, OpenedPathInfo, byte[], long, out int) : Mono.Unix.Native.Errno
Read data from an open file.
OnReadSymbolicLink (string, out string) : Mono.Unix.Native.Errno
Read the target of a symbolic link.
OnReleaseDirectory (string, OpenedPathInfo) : Mono.Unix.Native.Errno
Release a directory.
OnReleaseHandle (string, OpenedPathInfo) : Mono.Unix.Native.Errno
Close an opened file.
OnRemoveDirectory (string) : Mono.Unix.Native.Errno
Remove a directory
OnRemoveFile (string) : Mono.Unix.Native.Errno
Remove a directory entry.
OnRemovePathExtendedAttribute (string, string) : Mono.Unix.Native.Errno
Remove an extended attribute.
OnRenamePath (string, string) : Mono.Unix.Native.Errno
Rename a file or directory.
OnSetPathExtendedAttribute (string, string, byte[], Mono.Unix.Native.XattrFlags) : Mono.Unix.Native.Errno
Create or modify an extended attribute.
OnSynchronizeDirectory (string, OpenedPathInfo, bool) : Mono.Unix.Native.Errno
Synchronize directory contents.
OnSynchronizeHandle (string, OpenedPathInfo, bool) : Mono.Unix.Native.Errno
Synchronize file contents.
OnTruncateFile (string, long) : Mono.Unix.Native.Errno
Change the size of a file.
OnTruncateHandle (string, OpenedPathInfo, long) : Mono.Unix.Native.Errno
Change the size of an open file.
OnWriteHandle (string, OpenedPathInfo, byte[], long, out int) : Mono.Unix.Native.Errno
Write data to an open file.

Member Details

FileSystem Constructor

Creates and initializes a new instance of the Mono.Fuse.FileSystem class.

protected FileSystem ()

Remarks

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

FileSystem Constructor

Creates and initializes a new instance of the Mono.Fuse.FileSystem class for the specified mount point.

protected FileSystem (string mountPoint)

Parameters

mountPoint
A string containing the directory that should be mounted.

Remarks

This constructor initializes the FileSystem.MountPoint property to mountPoint.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

FileSystem Constructor

Creates and initializes a new instance of the Mono.Fuse.FileSystem class using the specified arguments.

protected FileSystem (string[] args)

Parameters

args
A string array containing FUSE arguments and the mountpoint.

Remarks

This constructor is equivalent to calling the FileSystem constructor, calling FileSystem.ParseFuseArguments with args, and setting FileSystem.MountPoint to the last array element in the array returned by ParseFuseArguments.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

ParseFuseArguments Method

Parses args looking for FUSE options.

public string[] ParseFuseArguments (string[] args)

Parameters

args
A string array containing the arguments to initialize the FUSE library with.

Returns

A string array containing any unhandled args elements.

Exceptions

Type Reason
ArgumentException If args contains a -o argument without a following string or string=value argument.

Remarks

This method parses args looking for FUSE-formatted arguments. A FUSE-formatted argument is one of:

  • -d to enable FUSE debug output. This is also equivalent to -odebug.
  • -f to enable foreground output. This is the only permitted behavior anyway, so it's simply ignored.
  • -s to disable multithreading support within FUSE. By default multithreading is enabled. (See also FileSystem.MultiThreaded.)
  • Any argument of the form -ostring, -ostring=value, and the argument pairs -o string, -o string=value. Any argument or argument pair matching this pattern will be handled by ParseFuseArguments.

This method initializes the FileSystem.FuseOptions property to contain the specified arguments.

Note:

If any non-FUSE arguments are captured by this method, they will be stored in FileSystem.FuseOptions and provided to FUSE during the FileSystem.Start method. If any non-FUSE arguments are passed to FUSE, FUSE will report an error.

Do not pass non-FUSE arguments to FUSE.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

ShowFuseHelp Method

Writes FUSE argument information to your programs standard error stream.

public static void ShowFuseHelp (string appname)

Parameters

appname
A string containing the program name to display within the help text.

Remarks

Use this method to show the FUSE arguments within your help information.

Example

FileSystem.ShowFuseHelp should be used to augment your help text generation when handling the standard --help argument.

C# Example
using System;
using Mono.Fuse;

class Help {
	public static void Main ()
	{
		FileSystem.ShowFuseHelp ("helpfs");
		Console.Error.WriteLine ("helpfs options:");
		Console.Error.WriteLine ("    --argument-name-here   Summary Information");
	}
}

The above program generates the output:

output Example
usage: helpfs mountpoint [options]

general options:
    -o opt,[opt...]        mount options
    -h   --help            print help
    -V   --version         print version

FUSE options:
    -d   -o debug          enable debug output (implies -f)
    -f                     foreground operation
    -s                     disable multi-threaded operation

    -o allow_other         allow access to other users
    -o allow_root          allow access to root
    -o nonempty            allow mounts over non-empty file/dir
    -o default_permissions enable permission checking by kernel
    -o fsname=NAME         set filesystem name
    -o large_read          issue large read requests (2.4 only)
    -o max_read=N          set maximum size of read requests

    -o hard_remove         immediate removal (don't hide files)
    -o use_ino             let filesystem set inode numbers
    -o readdir_ino         try to fill in d_ino in readdir
    -o direct_io           use direct I/O
    -o kernel_cache        cache files in kernel
    -o umask=M             set file permissions (octal)
    -o uid=N               set file owner
    -o gid=N               set file group
    -o entry_timeout=T     cache timeout for names (1.0s)
    -o negative_timeout=T  cache timeout for deleted names (0.0s)
    -o attr_timeout=T      cache timeout for attributes (1.0s)

helpfs options:
    --argument-name-here   Summary Information

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

Dispose Method

Cleans up FUSE resources.

public void Dispose ()

Remarks

This method should be called when FileSystem.Start returns.

If a subclass needs to cleanup its resources, it should override FileSystem.Dispose(bool).

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

Dispose Method

Release resources associated with this instance.

protected virtual void Dispose (bool disposing)

Parameters

disposing
A bool specifying whether this was called as a result of an explicit FileSystem.Dispose() call instead of through the finalizer.

Remarks

Subclasses should override this method if they need to release resources during class cleanup.

Note to Inheritors

Overridding implementations must call the Mono.Fuse.FileSystem base method as part of their implementation so that Mono.Fuse.FileSystem has a chance to cleanup FUSE.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

Start Method

Initializes FUSE and starts file system event processing.

public void Start ()

See Also

Exceptions

Type Reason
InvalidOperationException

FileSystem.MountPoint is null.

-or-

A file operation "set" was not fully implemented. Sets include:

NotSupportedException

There was an error initializing FUSE. This is frequently because the FUSE kernel module hasn't been loaded (try running /sbin/modprobe fuse as the root user) or FileSystem.MountPoint could not be mounted (it's not empty or it's already mounted).

FileSystem.MountPoint could not be mounted.

-or

A new FUSE instance could not be created.

Remarks

Creates a FUSE argument based on FileSystem.FuseOptions, initializes FUSE with these arguments, mounts the directory FileSystem.MountPoint, and starts event processing.

If FileSystem.MultiThreaded is true, then FUSE will be allowed to invoke Mono.Fuse.FileSystem operations in a multithreaded manner. Otherwise, only a single thread will be used to invoke FileSystem operations.

This method will not return until FileSystem.MountPoint is unmounted using the fusermount program or the FileSystem.Stop method is invoked.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

Stop Method

Exits the FUSE event loop.

public void Stop ()

Remarks

This method can be invoked to cause the FUSE event loop to stop, allowing FileSystem.Start to return.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

GetOperationContext Method

Gets a Mono.Fuse.FileSystemOperationContext instance containing additional contextual information for the current operation.

protected static FileSystemOperationContext GetOperationContext ()

Returns

A Mono.Fuse.FileSystemOperationContext instance containing conextual information for the current operation.

Remarks

This method should only be invoked from within an overridden method such as FileSystem.OnGetPathStatus to retrieve additional contextual information for the current file system operation.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnGetPathStatus Method

Get file or directory attributes.

protected virtual Mono.Unix.Native.Errno OnGetPathStatus (string path, [System.Runtime.InteropServices.Out] out Mono.Unix.Native.Stat stat)

Parameters

path
A string containing the file or directory to get the status of.
stat
A Mono.Unix.Native.Stat that will hold status information for path.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.EACCES

Search permission is denied for a component of the path prefix.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while reading from or writing to the file system.

Mono.Unix.Native.Errno.ELOOP

Too many symbolic links were encountered in translating the pathname.

Mono.Unix.Native.Errno.ENAMETOOLONG

A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters.

Mono.Unix.Native.Errno.ENOENT

The named file does not exist.

Mono.Unix.Native.Errno.ENOTDIR

A component of the path prefix is not a directory.

Mono.Unix.Native.Errno.EOVERFLOW

The file size in bytes cannot be represented correctly in the structure pointed to by stat .

Remarks

Similar to Mono.Unix.Native.Syscall.stat. The Mono.Unix.Native.Stat.st_dev and Mono.Unix.Native.Stat.st_blksize fields are ignored.

The Mono.Unix.Native.Stat.st_ino field is ignored unless the FileSystem.SetsInodes mount option is true.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnReadSymbolicLink Method

Read the target of a symbolic link.

protected virtual Mono.Unix.Native.Errno OnReadSymbolicLink (string link, [System.Runtime.InteropServices.Out] out string target)

Parameters

link
A string containing the file or directory to get the status of.
target
A string reference which will be filled in to contain the target of the symbolic link link.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.ENOTDIR

A component of the path prefix is not a directory.

Mono.Unix.Native.Errno.ENAMETOOLONG

A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters.

Mono.Unix.Native.Errno.ENOENT

The named file does not exist.

Mono.Unix.Native.Errno.EACCES

Search permission is denied for a component of the path prefix.

Mono.Unix.Native.Errno.ELOOP

Too many symbolic links were encountered in translating the pathname.

Mono.Unix.Native.Errno.EINVAL

The named file is not a symbolic link.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while reading from the file system.

Remarks

Simiar to Mono.Unix.Native.Syscall.readlink.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnCreateSpecialFile Method

Create a special or ordinary file.

protected virtual Mono.Unix.Native.Errno OnCreateSpecialFile (string file, Mono.Unix.Native.FilePermissions perms, ulong dev)

Parameters

file
A string containing the file or directory to get the status of.
perms
A Mono.Unix.Native.FilePermissions instance containing the permissions of the file to create.
dev
If perms is of the type Mono.Unix.Native.FilePermissions.S_IFCHR or Mono.Unix.Native.FilePermissions.S_IFBLK thsn dev is a ulong containing the major and minor numbers of the newly created device special file; otherwise, dev is ignored.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.ENOTDIR

A component of the path prefix is not a directory.

Mono.Unix.Native.Errno.ENAMETOOLONG

A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters.

Mono.Unix.Native.Errno.ENOENT

A component of the path prefix does not exist.

Mono.Unix.Native.Errno.EACCES

Search permission is denied for a component of the path prefix.

Mono.Unix.Native.Errno.ELOOP

Too many symbolic links were encountered in translating the pathname.

Mono.Unix.Native.Errno.EPERM

The process's effective user ID is not super-user.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while making the directory entry or allocating the inode.

Mono.Unix.Native.Errno.ENOSPC

The directory in which the entry for the new node is being placed cannot be extended because there is no space left on the file system containing the directory.

Mono.Unix.Native.Errno.ENOSPC

There are no free inodes on the file system on which the node is being created.

Mono.Unix.Native.Errno.EDQUOT

The directory in which the entry for the new node is being placed cannot be extended because the user's quota of disk blocks on the file system containing the directory has been exhausted.

Mono.Unix.Native.Errno.EDQUOT

The user's quota of inodes on the file system on which the node is being created has been exhausted.

Mono.Unix.Native.Errno.EROFS

The named file resides on a read-only file system.

Mono.Unix.Native.Errno.EEXIST

The named file exists.

Mono.Unix.Native.Errno.EINVAL

Creating anything else than a block or character special file (or a whiteout ) is not supported.

Remarks

Simiar to Mono.Unix.Native.Syscall.mknod. This is the Mono.Unix.Native.Syscall.mknod.

This is called for the creation of all non-directory, non-symlink nodes unless FileSystem.OnCreateHandle is overridden.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnCreateDirectory Method

Create a directory.

protected virtual Mono.Unix.Native.Errno OnCreateDirectory (string directory, Mono.Unix.Native.FilePermissions mode)

Parameters

directory
A string containing the file or directory to get the status of.
mode
A Mono.Unix.Native.FilePermissions instance containing the permissions of the directory to create.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.ENOTDIR

A component of the path prefix is not a directory.

Mono.Unix.Native.Errno.ENAMETOOLONG

A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters.

Mono.Unix.Native.Errno.ENOENT

A component of the path prefix does not exist.

Mono.Unix.Native.Errno.EACCES

Search permission is denied for a component of the path prefix, or write permission is denied on the parent directory of the directory to be created.

Mono.Unix.Native.Errno.ELOOP

Too many symbolic links were encountered in translating the pathname.

Mono.Unix.Native.Errno.EROFS

The named file resides on a read-only file system.

Mono.Unix.Native.Errno.EEXIST

The named file exists.

Mono.Unix.Native.Errno.ENOSPC

The new directory cannot be created because there is no space left on the file system that will contain the directory.

Mono.Unix.Native.Errno.ENOSPC

There are no free inodes on the file system on which the directory is being created.

Mono.Unix.Native.Errno.EDQUOT

The new directory cannot be created because the user's quota of disk blocks on the file system that will contain the directory has been exhausted.

Mono.Unix.Native.Errno.EDQUOT

The user's quota of inodes on the file system on which the directory is being created has been exhausted.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while making the directory entry or allocating the inode.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while reading from or writing to the file system.

Remarks

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnRemoveFile Method

Remove a directory entry.

protected virtual Mono.Unix.Native.Errno OnRemoveFile (string file)

Parameters

file
A string containing the file or directory to get the status of.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.ENOTDIR

A component of the path prefix is not a directory.

Mono.Unix.Native.Errno.ENAMETOOLONG

A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters.

Mono.Unix.Native.Errno.ENOENT

The named file does not exist.

Mono.Unix.Native.Errno.EACCES

Search permission is denied for a component of the path prefix.

Mono.Unix.Native.Errno.EACCES

Write permission is denied on the directory containing the link to be removed.

Mono.Unix.Native.Errno.ELOOP

Too many symbolic links were encountered in translating the pathname.

Mono.Unix.Native.Errno.EPERM

The named file is a directory.

Mono.Unix.Native.Errno.EPERM

The named file has its immutable or append-only flag set, see the Mono.Unix.Native.Syscall.chflags(2) manual page for more information.

Mono.Unix.Native.Errno.EPERM

The directory containing the file is marked sticky, and neither the containing directory nor the file to be removed are owned by the effective user ID.

Mono.Unix.Native.Errno.EBUSY

The entry to be unlinked is the mount point for a mounted file system.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while deleting the directory entry or deallocating the inode.

Mono.Unix.Native.Errno.EROFS

The named file resides on a read-only file system.

Remarks

Similar to Mono.Unix.Native.Syscall.unlink.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnRemoveDirectory Method

Remove a directory

protected virtual Mono.Unix.Native.Errno OnRemoveDirectory (string directory)

Parameters

directory
A string containing the directory to remove.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.ENOTDIR

A component of the path is not a directory.

Mono.Unix.Native.Errno.ENAMETOOLONG

A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters.

Mono.Unix.Native.Errno.ENOENT

The named directory does not exist.

Mono.Unix.Native.Errno.ELOOP

Too many symbolic links were encountered in translating the pathname.

Mono.Unix.Native.Errno.ENOTEMPTY

The named directory contains files other than "." and ".." in it.

Mono.Unix.Native.Errno.EACCES

Search permission is denied for a component of the path prefix.

Mono.Unix.Native.Errno.EACCES

Write permission is denied on the directory containing the link to be removed.

Mono.Unix.Native.Errno.EPERM

The directory containing the directory to be removed is marked sticky, and neither the containing directory nor the directory to be removed are owned by the effective user ID.

Mono.Unix.Native.Errno.EBUSY

The directory to be removed is the mount point for a mounted file system.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while deleting the directory entry or deallocating the inode.

Mono.Unix.Native.Errno.EROFS

The directory entry to be removed resides on a read-only file system.

Remarks

Similar to Mono.Unix.Native.Syscall.rmdir.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnCreateSymbolicLink Method

Create a symbolic link.

protected virtual Mono.Unix.Native.Errno OnCreateSymbolicLink (string target, string link)

Parameters

target
A string containing the target of the symbolic link.
link
A string containing the path of the symbolic link itself.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.ENOTDIR

A component of the name2 prefix is not a directory.

Mono.Unix.Native.Errno.ENAMETOOLONG

A component of either pathname exceeded 255 characters, or the entire length of either path name exceeded 1023 characters.

Mono.Unix.Native.Errno.ENOENT

The named file does not exist.

Mono.Unix.Native.Errno.EACCES

A component of the link path prefix denies search permission.

Mono.Unix.Native.Errno.ELOOP

Too many symbolic links were encountered in translating the pathname.

Mono.Unix.Native.Errno.EEXIST

The path name pointed at by the link argument already exists.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while making the directory entry for link , or allocating the inode for link , or writing out the link contents of link .

Mono.Unix.Native.Errno.EROFS

The file link would reside on a read-only file system.

Mono.Unix.Native.Errno.ENOSPC

The directory in which the entry for the new symbolic link is being placed cannot be extended because there is no space left on the file system containing the directory.

Mono.Unix.Native.Errno.ENOSPC

The new symbolic link cannot be created because there is no space left on the file system that will contain the symbolic link.

Mono.Unix.Native.Errno.ENOSPC

There are no free inodes on the file system on which the symbolic link is being created.

Mono.Unix.Native.Errno.EDQUOT

The directory in which the entry for the new symbolic link is being placed cannot be extended because the user's quota of disk blocks on the file system containing the directory has been exhausted.

Mono.Unix.Native.Errno.EDQUOT

The new symbolic link cannot be created because the user's quota of disk blocks on the file system that will contain the symbolic link has been exhausted.

Mono.Unix.Native.Errno.EDQUOT

The user's quota of inodes on the file system on which the symbolic link is being created has been exhausted.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while making the directory entry or allocating the inode.

Remarks

Similar to Mono.Unix.Native.Syscall.symlink.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnRenamePath Method

Rename a file or directory.

protected virtual Mono.Unix.Native.Errno OnRenamePath (string oldpath, string newpath)

Parameters

oldpath
A string containing the path to rename.
newpath
A string containing the new path name.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.ENAMETOOLONG

A component of either pathname exceeded 255 characters, or the entire length of either path name exceeded 1023 characters.

Mono.Unix.Native.Errno.ENOENT

A component of the oldpath path does not exist, or a path prefix of newpath does not exist.

Mono.Unix.Native.Errno.EACCES

A component of either path prefix denies search permission.

Mono.Unix.Native.Errno.EACCES

The requested link requires writing in a directory with a mode that denies write permission.

Mono.Unix.Native.Errno.EPERM

The directory containing oldpath is marked sticky, and neither the containing directory nor oldpath are owned by the effective user ID.

Mono.Unix.Native.Errno.EPERM

The file pointed at by the newpath argument exists, the directory containing newpath is marked sticky, and neither the containing directory nor newpath are owned by the effective user ID.

Mono.Unix.Native.Errno.ELOOP

Too many symbolic links were encountered in translating either pathname.

Mono.Unix.Native.Errno.ENOTDIR

A component of either path prefix is not a directory.

Mono.Unix.Native.Errno.ENOTDIR

The oldpath argument is a directory, but newpath is not a directory.

Mono.Unix.Native.Errno.EISDIR

The newpath argument is a directory, but oldpath is not a directory.

Mono.Unix.Native.Errno.EXDEV

The link named by newpath and the file named by oldpath are on different logical devices (file systems). Note that this error code will not be returned if the implementation permits cross-device links.

Mono.Unix.Native.Errno.ENOSPC

The directory in which the entry for the new name is being placed cannot be extended because there is no space left on the file system containing the directory.

Mono.Unix.Native.Errno.EDQUOT

The directory in which the entry for the new name is being placed cannot be extended because the user's quota of disk blocks on the file system containing the directory has been exhausted.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while making or updating a directory entry.

Mono.Unix.Native.Errno.EROFS

The requested link requires writing in a directory on a read-only file system.

Mono.Unix.Native.Errno.EFAULT

Path points outside the process's allocated address space.

Mono.Unix.Native.Errno.EINVAL

The oldpath argument is a parent directory of newpath , or an attempt is made to rename "." or ".."

Mono.Unix.Native.Errno.ENOTEMPTY

The newpath argument is a directory and is not empty.

Remarks

Similar to Mono.Unix.Native.Stdlib.rename.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnCreateHardLink Method

Create a hard link to a file.

protected virtual Mono.Unix.Native.Errno OnCreateHardLink (string oldpath, string link)

Parameters

oldpath
A string containing the path name to create a new reference to.
link
A string containing the file to create.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.ENOTDIR

A component of either path prefix is not a directory.

Mono.Unix.Native.Errno.ENAMETOOLONG

A component of either pathname exceeded 255 characters, or entire length of either path name exceeded 1023 characters.

Mono.Unix.Native.Errno.ENOENT

A component of either path prefix does not exist.

Mono.Unix.Native.Errno.EOPNOTSUPP

The file system containing the file named by name1 does not support links.

Mono.Unix.Native.Errno.EMLINK

The link count of the file named by name1 would exceed 32767.

Mono.Unix.Native.Errno.EACCES

A component of either path prefix denies search permission.

Mono.Unix.Native.Errno.EACCES

The requested link requires writing in a directory with a mode that denies write permission.

Mono.Unix.Native.Errno.ELOOP

Too many symbolic links were encountered in translating one of the pathnames.

Mono.Unix.Native.Errno.ENOENT

The file named by name1 does not exist.

Mono.Unix.Native.Errno.EEXIST

The link named by name2 does exist.

Mono.Unix.Native.Errno.EPERM

The file named by oldpath is a directory or is flagged immutable or append-only (see Mono.Unix.Native.Syscall.chflags(2) ) .

Mono.Unix.Native.Errno.EXDEV

The link named by link and the file named by link are on different file systems.

Mono.Unix.Native.Errno.ENOSPC

The directory in which the entry for the new link is being placed cannot be extended because there is no space left on the file system containing the directory.

Mono.Unix.Native.Errno.EDQUOT

The directory in which the entry for the new link is being placed cannot be extended because the user's quota of disk blocks on the file system containing the directory has been exhausted.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while reading from or writing to the file system to make the directory entry.

Mono.Unix.Native.Errno.EROFS

The requested link requires writing in a directory on a read-only file system.

Mono.Unix.Native.Errno.EFAULT

One of the pathnames specified is outside the process's allocated address space.

Remarks

Similar to Mono.Unix.Native.Syscall.link.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnChangePathPermissions Method

Change the permission bits of a file.

protected virtual Mono.Unix.Native.Errno OnChangePathPermissions (string path, Mono.Unix.Native.FilePermissions mode)

Parameters

path
A string containing the file or directory to get the status of.
mode
A Mono.Unix.Native.FilePermissions containing the new permissions for path.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.ENOTDIR

A component of the path prefix is not a directory.

Mono.Unix.Native.Errno.ENAMETOOLONG

A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters.

Mono.Unix.Native.Errno.ENOENT

The named file does not exist.

Mono.Unix.Native.Errno.EACCES

Search permission is denied for a component of the path prefix.

Mono.Unix.Native.Errno.ELOOP

Too many symbolic links were encountered in translating the pathname.

Mono.Unix.Native.Errno.EPERM

The effective user ID does not match the owner of the file and the effective user ID is not the super-user.

Mono.Unix.Native.Errno.EROFS

The named file resides on a read-only file system.

Mono.Unix.Native.Errno.EFAULT

The path argument points outside the process's allocated address space.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while reading from or writing to the file system.

Mono.Unix.Native.Errno.EFTYPE

An attempt was made to set the sticky bit upon an executable.

Remarks

Similar to Mono.Unix.Native.Syscall.chmod.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnChangePathOwner Method

Change owner and group of a file.

protected virtual Mono.Unix.Native.Errno OnChangePathOwner (string path, long owner, long group)

Parameters

path
A string containing the file or directory to get the status of.
owner
A long containing the new User ID of the owner.
group
A long containing the new Group id of the owner.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.ENOTDIR

A component of the path prefix is not a directory.

Mono.Unix.Native.Errno.ENAMETOOLONG

A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters.

Mono.Unix.Native.Errno.ENOENT

The named file does not exist.

Mono.Unix.Native.Errno.EACCES

Search permission is denied for a component of the path prefix.

Mono.Unix.Native.Errno.ELOOP

Too many symbolic links were encountered in translating the pathname.

Mono.Unix.Native.Errno.EPERM

The effective user ID is not the super-user.

Mono.Unix.Native.Errno.EROFS

The named file resides on a read-only file system.

Mono.Unix.Native.Errno.EFAULT

The path argument points outside the process's allocated address space.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while reading from or writing to the file system.

Remarks

Similar to Mono.Unix.Native.Syscall.chown.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnTruncateFile Method

Change the size of a file.

protected virtual Mono.Unix.Native.Errno OnTruncateFile (string file, long length)

Parameters

file
A string containing the file to truncate.
length
A long containing the new size of the file.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.ENOTDIR

A component of the path prefix is not a directory.

Mono.Unix.Native.Errno.ENAMETOOLONG

A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters.

Mono.Unix.Native.Errno.ENOENT

The named file does not exist.

Mono.Unix.Native.Errno.EACCES

Search permission is denied for a component of the path prefix.

Mono.Unix.Native.Errno.EACCES

The named file is not writable by the user.

Mono.Unix.Native.Errno.ELOOP

Too many symbolic links were encountered in translating the pathname.

Mono.Unix.Native.Errno.EISDIR

The named file is a directory.

Mono.Unix.Native.Errno.EROFS

The named file resides on a read-only file system.

Mono.Unix.Native.Errno.ETXTBSY

The file is a pure procedure (shared text) file that is being executed.

Mono.Unix.Native.Errno.EIO

An I/O error occurred updating the inode.

Remarks

Similar to Mono.Unix.Native.Syscall.truncate.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnChangePathTimes Method

Set file access and modification times.

protected virtual Mono.Unix.Native.Errno OnChangePathTimes (string path, ref Mono.Unix.Native.Utimbuf buf)

Parameters

path
A string containing the file or directory to get the status of.
buf
A Mono.Unix.Native.Utimbuf reference containing the new file access and modification times for path.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.EACCES Search permission is denied by a component of the path prefix; or the buf argument is a null pointer and the effective user ID of the process does not match the owner of the file, the process does not have write permission for the file, and the process does not have appropriate privileges.
Mono.Unix.Native.Errno.ELOOP

Too many symbolic links were encountered in translating the pathname.

Mono.Unix.Native.Errno.ENAMETOOLONG

A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters.

Mono.Unix.Native.Errno.ENOENT

The named file does not exist.

Mono.Unix.Native.Errno.ENOTDIR

A component of the path prefix is not a directory.

Mono.Unix.Native.Errno.EPERM The buf argument is not a null pointer and the calling process' effective user ID does not match the owner of the file and the calling process does not have the appropriate privileges.
Mono.Unix.Native.Errno.EROFS

The named file resides on a read-only file system.

Remarks

Similar to Mono.Unix.Native.Syscall.utime.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnOpenHandle Method

Open or create a file for reading or writing.

protected virtual Mono.Unix.Native.Errno OnOpenHandle (string file, OpenedPathInfo info)

See Also

Parameters

file
A string containing the file to open.
info
A Mono.Fuse.OpenedPathInfo instance which can be filled in to contain information about the opened file.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.ENOTDIR

A component of the path prefix is not a directory.

Mono.Unix.Native.Errno.ENAMETOOLONG

A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters.

Mono.Unix.Native.Errno.ENOENT

Mono.Unix.Native.OpenFlags.O_CREAT is not set and the named file does not exist.

Mono.Unix.Native.Errno.ENOENT

A component of the path name that must exist does not exist.

Mono.Unix.Native.Errno.EACCES

Search permission is denied for a component of the path prefix.

Mono.Unix.Native.Errno.EACCES

The required permissions (for reading and/or writing) are denied for the given flags.

Mono.Unix.Native.Errno.EACCES

Mono.Unix.Native.OpenFlags.O_CREAT is specified, the file does not exist, and the directory in which it is to be created does not permit writing.

Mono.Unix.Native.Errno.ELOOP

Too many symbolic links were encountered in translating the pathname.

Mono.Unix.Native.Errno.EISDIR

The named file is a directory, and the arguments specify it is to be opened for writing.

Mono.Unix.Native.Errno.EROFS

The named file resides on a read-only file system, and the file is to be modified.

Mono.Unix.Native.Errno.EMFILE

The process has already reached its limit for open file descriptors.

Mono.Unix.Native.Errno.ENFILE

The system file table is full.

Mono.Unix.Native.Errno.EMLINK

Mono.Unix.Native.OpenFlags.O_NOFOLLOW was specified and the target is a symbolic link.

Mono.Unix.Native.Errno.ENXIO

The named file is a character special or block special file, and the device associated with this special file does not exist.

Mono.Unix.Native.Errno.ENXIO

The named file is a fifo, no process has it open for reading, and the arguments specify it is to be opened for writing.

Mono.Unix.Native.Errno.EINTR

The open() operation was interrupted by a signal.

Mono.Unix.Native.Errno.EOPNOTSUPP

Mono.Unix.Native.OpenFlags.O_SHLOCK or Mono.Unix.Native.OpenFlags.O_EXLOCK is specified but the underlying file system does not support locking.

Mono.Unix.Native.Errno.EOPNOTSUPP

The named file is a special file mounted through a file system that does not support access to it (e.g. NFS).

Mono.Unix.Native.Errno.EWOULDBLOCK

Mono.Unix.Native.OpenFlags.O_NONBLOCK and one of Mono.Unix.Native.OpenFlags.O_SHLOCK or Mono.Unix.Native.OpenFlags.O_EXLOCK is specified and the file is locked.

Mono.Unix.Native.Errno.ENOSPC

Mono.Unix.Native.OpenFlags.O_CREAT is specified, the file does not exist, and the directory in which the entry for the new file is being placed cannot be extended because there is no space left on the file system containing the directory.

Mono.Unix.Native.Errno.ENOSPC

Mono.Unix.Native.OpenFlags.O_CREAT is specified, the file does not exist, and there are no free inodes on the file system on which the file is being created.

Mono.Unix.Native.Errno.EDQUOT

Mono.Unix.Native.OpenFlags.O_CREAT is specified, the file does not exist, and the directory in which the entry for the new file is being placed cannot be extended because the user's quota of disk blocks on the file system containing the directory has been exhausted.

Mono.Unix.Native.Errno.EDQUOT

Mono.Unix.Native.OpenFlags.O_CREAT is specified, the file does not exist, and the user's quota of inodes on the file system on which the file is being created has been exhausted.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while making the directory entry or allocating the inode for Mono.Unix.Native.OpenFlags.O_CREAT .

Mono.Unix.Native.Errno.ETXTBSY

The file is a pure procedure (shared text) file that is being executed and the open() system call requests write access.

Mono.Unix.Native.Errno.EEXIST

Mono.Unix.Native.OpenFlags.O_CREAT and Mono.Unix.Native.OpenFlags.O_EXCL were specified and the file exists.

Mono.Unix.Native.Errno.EOPNOTSUPP

An attempt was made to open a socket (not currently implemented).

Mono.Unix.Native.Errno.EINVAL

An attempt was made to open a descriptor with an illegal combination of Mono.Unix.Native.OpenFlags.O_RDONLY , Mono.Unix.Native.OpenFlags.O_WRONLY , and Mono.Unix.Native.OpenFlags.O_RDWR .

Remarks

Similar to Mono.Unix.Native.Syscall.open.

No creation or truncation flags such as Mono.Unix.Native.OpenFlags.O_CREAT, Mono.Unix.Native.OpenFlags.O_EXCL, and Mono.Unix.Native.OpenFlags.O_TRUNC, will be passed in OpenedPathInfo.OpenFlags. This method should check if the operation is permitted for the given flags. Open may optionally return an arbitrary file handle by filling in OpenedPathInfo.Handle, which will be provided to all subsequent handle operations.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnReadHandle Method

Read data from an open file.

protected virtual Mono.Unix.Native.Errno OnReadHandle (string file, OpenedPathInfo info, byte[] buf, long offset, [System.Runtime.InteropServices.Out] out int bytesWritten)

Parameters

file
A string containing the file to read.
info
A Mono.Fuse.OpenedPathInfo instance which contains information about the file to read.
buf
A byte array containing the buffer to fill in. buf.Length bytes should be written if possible; see the remarks for more information.
offset
A long containing the offset within file to begin reading.
bytesWritten
A int reference containing the number of bytes written to buf. This should be equal to buf.Length if possible; see the remakrs for more information.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.EBADF

The info.Handle argument is not a valid file or socket descriptor open for reading.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while reading from the file system.

Mono.Unix.Native.Errno.EINTR

A read from a slow device was interrupted before any data arrived by the delivery of a signal.

Mono.Unix.Native.Errno.EAGAIN

The file was marked for non-blocking I/O, and no data were ready to be read.

Mono.Unix.Native.Errno.EISDIR

The file descriptor is associated with a directory residing on a file system that does not allow regular read operations on directories (e.g. NFS).

Mono.Unix.Native.Errno.EOPNOTSUPP

The file descriptor is associated with a file system and file type that do not allow regular read operations on it.

Mono.Unix.Native.Errno.EOVERFLOW

The file descriptor is associated with a regular file, buf.Length is greater than 0, offset is before the end-of-file, and offset is greater than or equal to the offset maximum established for this file system.

Remarks

Similar to Mono.Unix.Native.Syscall.pread.

This method should set bytesWritten to exactly the number of bytes requested (buf.Length) except on end-of-file or error, otherwise the rest of the data will be substituted with zeros. An exception to this is when the FileSystem.EnableDirectIO mount option is true, in which case the return value of the Mono.Unix.Native.Syscall.read system call will reflect the value bytesWritten.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnWriteHandle Method

Write data to an open file.

protected virtual Mono.Unix.Native.Errno OnWriteHandle (string file, OpenedPathInfo info, byte[] buf, long offset, [System.Runtime.InteropServices.Out] out int bytesRead)

Parameters

file
A string containing the file or directory to get the status of.
info
A Mono.Fuse.OpenedPathInfo instance containing information about the opened file.
buf
A byte array containing the data that should be written.
offset
A long containing the offset within file to begin writing.
bytesRead
A int reference that should be filled in to contain the number of bytes read from buf.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.EBADF

The info.Handle argument is not a valid descriptor open for writing.

Mono.Unix.Native.Errno.EPIPE

An attempt is made to write to a pipe that is not open for reading by any process.

Mono.Unix.Native.Errno.EPIPE

An attempt is made to write to a socket of type Mono.Unix.Native.Errno.SOCK_STREAM that is not connected to a peer socket.

Mono.Unix.Native.Errno.EFBIG

An attempt was made to write a file that exceeds the process's file size limit or the maximum file size.

Mono.Unix.Native.Errno.ENOSPC

There is no free space remaining on the file system containing the file.

Mono.Unix.Native.Errno.EDQUOT

The user's quota of disk blocks on the file system containing the file has been exhausted.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while reading from or writing to the file system.

Mono.Unix.Native.Errno.EINTR

A signal interrupted the write before it could be completed.

Mono.Unix.Native.Errno.EAGAIN

The file was marked for non-blocking I/O, and no data could be written immediately.

Mono.Unix.Native.Errno.EROFS

An attempt was made to write over a disk label area at the beginning of a slice. Use disklabel(8) to enable writing on the disk label area.

Remarks

Similar to Mono.Unix.Native.Syscall.pwrite.

This method should set bytesRead to exactly the number of bytes requested (buf.Length) except on end-of-file or error, otherwise the rest of the data will be substituted with zeros. An exception to this is when the FileSystem.EnableDirectIO mount option is true, in which case the return value of the Mono.Unix.Native.Syscall.write system call will reflect the value bytesWritten.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnGetFileSystemStatus Method

Get file system statistics.

protected virtual Mono.Unix.Native.Errno OnGetFileSystemStatus (string path, [System.Runtime.InteropServices.Out] out Mono.Unix.Native.Statvfs buf)

Parameters

path
A string containing the file or directory to get the status of.
buf
A Mono.Unix.Native.Statvfs reference which should be filled in to contain information about the mounted file system.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.EACCES

Search permission is denied for a component of the path prefix.

Mono.Unix.Native.Errno.EINTR

A signal interrupted the write before it could be completed.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while reading from or writing to the file system.

Mono.Unix.Native.Errno.ELOOP

Too many symbolic links were encountered in translating the pathname.

Mono.Unix.Native.Errno.ENAMETOOLONG

A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters.

Mono.Unix.Native.Errno.ENOENT

A component of the path name that must exist does not exist.

Mono.Unix.Native.Errno.ENOSYS

The file system does not support this call.

Mono.Unix.Native.Errno.ENOTDIR

A component of the path prefix is not a directory.

Mono.Unix.Native.Errno.EOVERFLOW

Some values were too large to be represented in the returned structure.

Remarks

Similar to Mono.Unix.Native.Syscall.statvfs.

The Mono.Unix.Native.Statvfs.f_frsize, Mono.Unix.Native.Statvfs.f_favail, Mono.Unix.Native.Statvfs.f_fsid, and Mono.Unix.Native.Statvfs.f_flag fields are ignored.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnFlushHandle Method

Possibly flush cached data.

protected virtual Mono.Unix.Native.Errno OnFlushHandle (string file, OpenedPathInfo info)

Parameters

file
A string containing the file name to flush.
info
A Mono.Fuse.OpenedPathInfo instance containing information about the opened file.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.EBADF

The d argument is not an active descriptor.

Mono.Unix.Native.Errno.EINTR

An interrupt was received.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while reading from or writing to the file system.

Mono.Unix.Native.Errno.ENOSPC

The underlying object did not fit, cached data was lost.

Remarks

This is vaguely similar to Mono.Unix.Native.Syscall.close.

This is not equivalent to Mono.Unix.Native.Syscall.fsync. This is not a request to sync dirty data.

FileSystem.OnFlushHandle is called on each Mono.Unix.Native.Syscall.close of a file descriptor. So if a file system wants to return write errors in close(2) and and the file has cached dirty data, this is a good place to write back data and return any errors. Since many applications ignore close(2) errors this is not always useful.

Note:

The FileSystem.OnFlushHandle method may be called more than once for each FileSystem.OnOpenHandle. This happens if more than one file descriptor refers to an opened file due to Mono.Unix.Nativev.Syscall.dup, Mono.Unix.Nativev.Syscall.dup2, or fork(2) calls. It is not possible to determine if a flush is final, so each flush should be treated equally. Multiple write-flush sequences are relatively rare, so this shouldn't be a problem.

File systems shouldn't assume that FileSystem.OnFlushHandle will always be called after some writes, or that it will be called at all.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnReleaseHandle Method

Close an opened file.

protected virtual Mono.Unix.Native.Errno OnReleaseHandle (string file, OpenedPathInfo info)

Parameters

file
A string containing the file to release.
info
A Mono.Fuse.OpenedPathInfo instance containing information about the opened file.

Returns

The return value is ignored.

Remarks

Vaguely similar to Mono.Unix.Native.Syscall.close.

FileSystem.OnReleaseHandle is called when there are no more references to an open file: all file descriptors have been closed and all memory mappings have been unmapped.

For every FileSystem.OnOpenHandle call there will be exactly one FileSystem.OnReleaseHandle call with the same OpenedPathInfo.OpenFlags and OpenedPathInfo.Handle. It is possible to have a file opened more than once, in which case only the last release will mean that no more reads/writes will happen on the file.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnSynchronizeHandle Method

Synchronize file contents.

protected virtual Mono.Unix.Native.Errno OnSynchronizeHandle (string file, OpenedPathInfo info, bool onlyUserData)

Parameters

file
A string containing the file to synchronize.
info
A Mono.Fuse.OpenedPathInfo instance containing information about the opened file.
onlyUserData
A bool; if true, then only the user data should be flushed, and not the meta data.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.EBADF

The info.Handle argument is not a valid descriptor.

Mono.Unix.Native.Errno.EINVAL

The info.Handle argument refers to a socket, not to a file.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while reading from or writing to the file system.

Remarks

Similar to Mono.Unix.Native.Syscall.fdatasync if onlyUserData is true, otherwise similar to Mono.Unix.Native.Syscall.fsync.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnSetPathExtendedAttribute Method

Create or modify an extended attribute.

protected virtual Mono.Unix.Native.Errno OnSetPathExtendedAttribute (string path, string name, byte[] value, Mono.Unix.Native.XattrFlags flags)

Parameters

path
A string containing path name on which to set the extended attribute.
name
A string containing the name of the extended attribute to set.
value
A byte array containing the value of the extended value.
flags
A Mono.Unix.Native.XattrFlags instance containing flags to control the extended attribute creation process.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.EEXIST If Mono.Unix.Native.XattrFlags.XATTR_CREATE is specified and the attribute already exists.
Mono.Unix.Native.Errno.EDQUOT The user's quota of disk blocks on the file system containing the file has been exhausted.
Mono.Unix.Native.Errno.ENODATA If Mono.Unix.Native.XattrFlags.XATTR_REPLACE is specified and the attribute does not exist.
Mono.Unix.Native.Errno.ENOSPC There is insufficient space to store the extended attribute.
Mono.Unix.Native.Errno.ENOTSUP Extended attributes are not supported by the file system.

The errors returned from FileSystem.OnGetPathStatus are also applicable.

Remarks

Similar to Mono.Unix.Native.Syscall.setxattr.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnGetPathExtendedAttribute Method

Retreive an extended attribute value.

protected virtual Mono.Unix.Native.Errno OnGetPathExtendedAttribute (string path, string name, byte[] value, [System.Runtime.InteropServices.Out] out int bytesWritten)

Parameters

path
A string containing path name on which to get the extended attribute.
name
A string containing the name of the extended attribute to retrieve.
value
A byte array to be filled in with the value of the extended attribute name.
bytesWritten
A int reference which will be initializaed to contain the number of bytes written into value.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.ENODATA The extended attribute name does not exist.
Mono.Unix.Native.Errno.ERANGE value.Length is too small to hold the result.
Mono.Unix.Native.Errno.ENOTSUP Extended attributes are not supported by the file system.

The errors returned from FileSystem.OnGetPathStatus are also applicable.

Remarks

Similar to Mono.Unix.Native.Syscall.getxattr.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnListPathExtendedAttributes Method

List extended attribute names.

protected virtual Mono.Unix.Native.Errno OnListPathExtendedAttributes (string path, [System.Runtime.InteropServices.Out] out string[] names)

Parameters

path
A string containing the path name on which to retrieve the current extended attribute names.
names
A string array reference which should be filled in to contain the names of the extended attributes available on path.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.ENOTSUP Extended attributes are not supported by the file system.

The errors returned from FileSystem.OnGetPathStatus are also applicable.

Remarks

Similar to Mono.Unix.Native.Syscall.listxttr.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnRemovePathExtendedAttribute Method

Remove an extended attribute.

protected virtual Mono.Unix.Native.Errno OnRemovePathExtendedAttribute (string path, string name)

Parameters

path
A string containing path to modify.
name
A string containing the extended attribute to remove.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.ENODATA The extended attribute name does not exist.
Mono.Unix.Native.Errno.ENOTSUP Extended attributes are not supported by the file system.

The errors returned from FileSystem.OnGetPathStatus are also applicable.

Remarks

Similar to Mono.Unix.Native.Syscall.removexattr.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnOpenDirectory Method

Open a directory for later reading.

protected virtual Mono.Unix.Native.Errno OnOpenDirectory (string directory, OpenedPathInfo info)

Parameters

directory
A string containing the directory to open.
info
A Mono.Fuse.OpenedPathInfo instance containing information about the opened directory.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.EACCES

Search permission is denied for a component of the path prefix.

Mono.Unix.Native.Errno.EMFILE

The process has already reached its limit for open file descriptors.

Mono.Unix.Native.Errno.ENFILE

The system file table is full.

Mono.Unix.Native.Errno.ENOENT

A component of the path name that must exist does not exist.

Mono.Unix.Native.Errno.ENOMEM

Insufficient memory to complete the operation.

Mono.Unix.Native.Errno.ENOTDIR

directory is not a directory.

Remarks

Similar to Mono.Unix.Native.Syscall.opendir.

This method does not need to be overridden in order to support directory traversal. It is valid to just override FileSystem.OnReadDirectory without overridding FileSystem.OnOpenDirectory.

If this method is overridden, it will be invoked before any calls to FileSystem.OnReadDirectory, followed by a call to FileSystem.OnReleaseDirectory.

This method should check if the operation is permitted for the directory directory.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnReadDirectory Method

Read the files in a directory.

protected virtual Mono.Unix.Native.Errno OnReadDirectory (string directory, OpenedPathInfo info, [System.Runtime.InteropServices.Out] out IEnumerable<DirectoryEntry> paths)

Parameters

directory
A string containing the directory to read.
info
A Mono.Fuse.OpenedPathInfo instance containing information about the opened directory.
paths
A reference to a IEnumerable`1 interface specialized for the Mono.Fuse.DirectoryEntry type.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.EBADF

The info.Handle argument is not a valid descriptor (if FileSystem.OnOpenDirectory was overridden).

Mono.Unix.Native.Errno.EACCES

Search permission is denied for a component of the path prefix.

Mono.Unix.Native.Errno.EMFILE

The process has already reached its limit for open file descriptors.

Mono.Unix.Native.Errno.ENFILE

The system file table is full.

Mono.Unix.Native.Errno.ENOENT

A component of the path name that must exist does not exist.

Mono.Unix.Native.Errno.ENOMEM

Insufficient memory to complete the operation.

Mono.Unix.Native.Errno.ENOTDIR

directory is not a directory.

Remarks

Similar to Mono.Unix.Native.Syscall.readdir.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnReleaseDirectory Method

Release a directory.

protected virtual Mono.Unix.Native.Errno OnReleaseDirectory (string directory, OpenedPathInfo info)

Parameters

directory
A string containing the directory to release.
info
A Mono.Fuse.OpenedPathInfo instance containing information about the opened directory.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.EBADF

The info.Handle argument is not a valid descriptor.

Remarks

Similar to Mono.Unix.Native.Syscall.closedir.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnSynchronizeDirectory Method

Synchronize directory contents.

protected virtual Mono.Unix.Native.Errno OnSynchronizeDirectory (string directory, OpenedPathInfo info, bool onlyUserData)

Parameters

directory
A string containing the directory to synchronize.
info
A Mono.Fuse.OpenedPathInfo instance containing information about the opened directory.
onlyUserData
A bool; if true, then only the user data should be flushed, not meta data.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.EBADF

The info.Handle argument is not a valid descriptor.

Mono.Unix.Native.Errno.EINVAL

The info.Handle argument refers to a socket, not to a file.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while reading from or writing to the file system.

Remarks

Similar to Mono.Unix.Native.Syscall.fdatasync if onlyUserData is true, otherwise similar to Mono.Unix.Native.Syscall.fsync.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnAccessPath Method

Check file access permissions.

protected virtual Mono.Unix.Native.Errno OnAccessPath (string path, Mono.Unix.Native.AccessModes mode)

Parameters

path
A string containing the path to check the access of.
mode
A Mono.Unix.Native.AccessModes instance containing the requested access mode to check.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.ENOTDIR

A component of the path prefix is not a directory.

Mono.Unix.Native.Errno.ENAMETOOLONG

A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters.

Mono.Unix.Native.Errno.ENOENT

The named file does not exist.

Mono.Unix.Native.Errno.ELOOP

Too many symbolic links were encountered in translating the pathname.

Mono.Unix.Native.Errno.EROFS

Write access is requested for a file on a read-only file system.

Mono.Unix.Native.Errno.ETXTBSY

Write access is requested for a pure procedure (shared text) file presently being executed.

Mono.Unix.Native.Errno.EACCES

Permission bits of the file mode do not permit the requested access, or search permission is denied on a component of the path prefix.

Mono.Unix.Native.Errno.EFAULT

The path argument points outside the process's allocated address space.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while reading from or writing to the file system.

Remarks

Similar to Mono.Unix.Native.Syscall.access.

If the FileSystem.EnableKernelPermissionChecking mount option is given, this method is not called.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnCreateHandle Method

Create and open a file.

protected virtual Mono.Unix.Native.Errno OnCreateHandle (string file, OpenedPathInfo info, Mono.Unix.Native.FilePermissions mode)

Parameters

file
A string containing the file to create.
info
A Mono.Fuse.OpenedPathInfo instance containing information about the opened file.
mode
A Mono.Unix.Native.FilePermissions instance containing the file permissions of the file to create.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.ENOTDIR

A component of the path prefix is not a directory.

Mono.Unix.Native.Errno.ENAMETOOLONG

A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters.

Mono.Unix.Native.Errno.ENOENT

Mono.Unix.Native.OpenFlags.O_CREAT is not set and the named file does not exist.

Mono.Unix.Native.Errno.ENOENT

A component of the path name that must exist does not exist.

Mono.Unix.Native.Errno.EACCES

Search permission is denied for a component of the path prefix.

Mono.Unix.Native.Errno.EACCES

The required permissions (for reading and/or writing) are denied for the given flags.

Mono.Unix.Native.Errno.EACCES

Mono.Unix.Native.OpenFlags.O_CREAT is specified, the file does not exist, and the directory in which it is to be created does not permit writing.

Mono.Unix.Native.Errno.ELOOP

Too many symbolic links were encountered in translating the pathname.

Mono.Unix.Native.Errno.EISDIR

The named file is a directory, and the arguments specify it is to be opened for writing.

Mono.Unix.Native.Errno.EROFS

The named file resides on a read-only file system, and the file is to be modified.

Mono.Unix.Native.Errno.EMFILE

The process has already reached its limit for open file descriptors.

Mono.Unix.Native.Errno.ENFILE

The system file table is full.

Mono.Unix.Native.Errno.EMLINK

Mono.Unix.Native.OpenFlags.O_NOFOLLOW was specified and the target is a symbolic link.

Mono.Unix.Native.Errno.ENXIO

The named file is a character special or block special file, and the device associated with this special file does not exist.

Mono.Unix.Native.Errno.ENXIO

The named file is a fifo, no process has it open for reading, and the arguments specify it is to be opened for writing.

Mono.Unix.Native.Errno.EINTR

The open() operation was interrupted by a signal.

Mono.Unix.Native.Errno.EOPNOTSUPP

Mono.Unix.Native.OpenFlags.O_SHLOCK or Mono.Unix.Native.OpenFlags.O_EXLOCK is specified but the underlying file system does not support locking.

Mono.Unix.Native.Errno.EOPNOTSUPP

The named file is a special file mounted through a file system that does not support access to it (e.g. NFS).

Mono.Unix.Native.Errno.EWOULDBLOCK

Mono.Unix.Native.OpenFlags.O_NONBLOCK and one of Mono.Unix.Native.OpenFlags.O_SHLOCK or Mono.Unix.Native.OpenFlags.O_EXLOCK is specified and the file is locked.

Mono.Unix.Native.Errno.ENOSPC

Mono.Unix.Native.OpenFlags.O_CREAT is specified, the file does not exist, and the directory in which the entry for the new file is being placed cannot be extended because there is no space left on the file system containing the directory.

Mono.Unix.Native.Errno.ENOSPC

Mono.Unix.Native.OpenFlags.O_CREAT is specified, the file does not exist, and there are no free inodes on the file system on which the file is being created.

Mono.Unix.Native.Errno.EDQUOT

Mono.Unix.Native.OpenFlags.O_CREAT is specified, the file does not exist, and the directory in which the entry for the new file is being placed cannot be extended because the user's quota of disk blocks on the file system containing the directory has been exhausted.

Mono.Unix.Native.Errno.EDQUOT

Mono.Unix.Native.OpenFlags.O_CREAT is specified, the file does not exist, and the user's quota of inodes on the file system on which the file is being created has been exhausted.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while making the directory entry or allocating the inode for Mono.Unix.Native.OpenFlags.O_CREAT .

Mono.Unix.Native.Errno.ETXTBSY

The file is a pure procedure (shared text) file that is being executed and the open() system call requests write access.

Mono.Unix.Native.Errno.EEXIST

Mono.Unix.Native.OpenFlags.O_CREAT and Mono.Unix.Native.OpenFlags.O_EXCL were specified and the file exists.

Mono.Unix.Native.Errno.EOPNOTSUPP

An attempt was made to open a socket (not currently implemented).

Mono.Unix.Native.Errno.EINVAL

An attempt was made to open a descriptor with an illegal combination of Mono.Unix.Native.OpenFlags.O_RDONLY , Mono.Unix.Native.OpenFlags.O_WRONLY , and Mono.Unix.Native.OpenFlags.O_RDWR .

Remarks

Similar to Mono.Unix.Native.Syscall.creat.

If the file does not exist, first create it with the specified mode and then open it.

If this method is not overridden (or under Linux kernel versions earlier than 2.6.15), then the FileSystem.OnCreateSpecialFile and FileSystem.OnOpenHandle methods will be called instead.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnTruncateHandle Method

Change the size of an open file.

protected virtual Mono.Unix.Native.Errno OnTruncateHandle (string file, OpenedPathInfo info, long length)

Parameters

file
A string containing the file to truncate.
info
A Mono.Fuse.OpenedPathInfo instance containing information about the opened file.
length
A long containing the new file size.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.EBADF

The fd argument is not a valid descriptor.

Mono.Unix.Native.Errno.EINVAL

The fd argument references a socket, not a file.

Mono.Unix.Native.Errno.EINVAL

The fd descriptor is not open for writing.

Remarks

Similar to Mono.Unix.Native.Syscall.ftruncate.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

OnGetHandleStatus Method

Get attributes of an open file.

protected virtual Mono.Unix.Native.Errno OnGetHandleStatus (string file, OpenedPathInfo info, [System.Runtime.InteropServices.Out] out Mono.Unix.Native.Stat buf)

Parameters

file
A string containing the file to get the status of.
info
A Mono.Fuse.OpenedPathInfo instance containing information about the opened file.
buf
A Mono.Unix.Native.Stat instance which should be filled in to contain information about the open file info.

Returns

Returns 0 if successful; otherwise, returns the reason for the failure.

Usage

The following errors can be returned:

Error Details
Mono.Unix.Native.Errno.EBADF

The fd argument is not a valid open file descriptor.

Mono.Unix.Native.Errno.EFAULT

The sb argument points to an invalid address.

Mono.Unix.Native.Errno.EIO

An I/O error occurred while reading from or writing to the file system.

Mono.Unix.Native.Errno.EOVERFLOW

The file size in bytes cannot be represented correctly in the structure pointed to by sb .

Remarks

Similar to Mono.Unix.Native.Syscall.fstat.

This is currently only called after FileSystem.OnCreateHandle (if OnCreateHandle is implemented). It may be called for invocations of Mono.Unix.Native.Syscall.fstat in the future.

Note to Inheritors

Overriding implementations should not generate an exception. All exceptions which escape this method are translated into Mono.Unix.Native.Errno.EIO.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

FuseOptions Property

FUSE startup options.

public IDictionary<string, string> FuseOptions { get; }

See Also

Value

A IDictionary`2 instance containing options to initialize FUSE with when FileSystem.Start is called.

Remarks

This must only contain FUSE-recognized options, otherwise FUSE will report an error and FileSystem.Start will generate a NotSupportedException.

This property is present so that if FUSE gains additional options, the new options can be used without requiring an update to Mono.Fuse.FileSystem.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

EnableFuseDebugOutput Property

Enable generation of FUSE debug messages to the standard output stream.

public bool EnableFuseDebugOutput { set; get; }

See Also

Value

A bool indicating whether FUSE should send debug messages to the standard output stream.

Remarks

This property can be set to true with the -o debug or -d arguments; it is false by default.

If this property is true, then FileSystem.FuseOptions will have an entry for the debug key.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

AllowAccessToOthers Property

Allow access to other users.

public bool AllowAccessToOthers { set; get; }

See Also

Value

A bool indicating whether other users can access this file system.

Remarks

This property can be set to true with the -o allow_other argument; it is false by default.

When this property is false, then the file system can only be accessed by programs executed by the same User ID as the user who started this file system.

If this property is true, then FileSystem.FuseOptions will have an entry for the allow_other key.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

AllowAccessToRoot Property

Allow access to other users.

public bool AllowAccessToRoot { set; get; }

See Also

Value

A bool indicating whether the root user can access this file system.

Remarks

This property can be set to true with the -o allow_root argument; it is false by default.

When this property is false, then the file system can not be accessed by the root user.

If this property is true, then FileSystem.FuseOptions will have an entry for the allow_root key.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

AllowMountOverNonEmptyDirectory Property

Allow mounting over a non-empty directory.

public bool AllowMountOverNonEmptyDirectory { set; get; }

See Also

Value

A bool indicating whether this file system can be mounted over a non-empty directory.

Remarks

This property can be set to true with the -o nonempty argument; it is false by default.

When this property is true, then FileSystem.MountPoint does not need to be an empty directory. Normally, if this property is false then FileSystem.Start will throw a NotSupportedException if the directory is not empty.

If this property is true, then FileSystem.FuseOptions will have an entry for the nonempty key.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

EnableKernelPermissionChecking Property

Enable permission checking by the OS kernel.

public bool EnableKernelPermissionChecking { set; get; }

See Also

Value

A bool indicating whether the OS kernel should perform permission checking.

Remarks

This property can be set to true with the -o default_permissions argument; it is false by default.

If this property is true, then FileSystem.FuseOptions will have an entry for the default_permissions key.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

Name Property

Gets or sets the file system name.

public string Name { set; get; }

See Also

Value

A string containing the file system name.

Remarks

TODO: why care about the file system name?

This property can be set with the -o fsname=NAME argument; it is null by default.

If this property is set then FileSystem.FuseOptions will have an entry for the fsname key, the value of which is the file system name.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

EnableLargeReadRequests Property

Issue large read requests.

public bool EnableLargeReadRequests { set; get; }

See Also

Value

A bool indicating whether the OS kernel should issue large read requests.

Remarks

This is for the Linux kernel 2.4 version of FUSE only.

This property can be set to true with the -o large_read argument; it is false by default.

If this property is true, then FileSystem.FuseOptions will have an entry for the large_read key.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

MaxReadSize Property

Gets or sets the maximum size of read requests.

public int MaxReadSize { set; get; }

See Also

Value

A int containing the maximum size of the read requests.

Remarks

This property can be set with the -o max_read=N argument; it is 0 by default.

If this property is set then FileSystem.FuseOptions will have an entry for the max_read key, the value of which is the maximum size for read requests. Otherwise there will be no entry in FileSystem.FuseOptions, and 0 will be returned from the property getter.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

ImmediatePathRemoval Property

Immediately remove file and directories, don't hide them.

public bool ImmediatePathRemoval { set; get; }

See Also

Value

A bool indicating whether files and directories should be immediately removed and not hidden.

Remarks

This property can be set to true with the -o hard_remove argument; it is false by default.

If this property is true, then FileSystem.FuseOptions will have an entry for the hard_remove key.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

SetsInodes Property

FileSystem sets inode numbers.

public bool SetsInodes { set; get; }

See Also

Value

A bool indicating whether the file system sets inode numbers.

Remarks

This property can be set to true with the -o use_ino argument; it is false by default.

If this property is true, then FileSystem.FuseOptions will have an entry for the use_ino key.

Set this property to true if your overridden version of FileSystem.OnReadDirectory sets the Mono.Unix.Native.Stat.st_ino field in the DirectoryEntry.Stat field. Otherwise, the Mono.Unix.Native.Stat.st_ino field value will be ignored.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

ReaddirSetsInode Property

Readdir sets inodes.

public bool ReaddirSetsInode { set; get; }

See Also

Value

A bool indicating whether the file system sets inode numbers.

Remarks

TODO: How does this differ from FileSystem.SetsInodes?

This property can be set to true with the -o readdir_ino argument; it is false by default.

If this property is true, then FileSystem.FuseOptions will have an entry for the readdir_ino key.

Set this property to true if your overridden version of FileSystem.OnReadDirectory sets the Mono.Unix.Native.Stat.st_ino field in the DirectoryEntry.Stat field. Otherwise, the Mono.Unix.Native.Stat.st_ino field value will be ignored.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

EnableDirectIO Property

Enable Direct I/O.

public bool EnableDirectIO { set; get; }

See Also

Value

A bool indicating whether the file system should use direct I/O.

Remarks

TODO: What's this really control?

This property can be set to true with the -o direct_io argument; it is false by default.

If this property is true, then FileSystem.FuseOptions will have an entry for the direct_io key.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

EnableKernelCache Property

Cache files in kernel.

public bool EnableKernelCache { set; get; }

See Also

Value

A bool indicating whether files should be cached in the kernel.

Remarks

TODO: What's this really control?

This property can be set to true with the -o kernel_cache argument; it is false by default.

If this property is true, then FileSystem.FuseOptions will have an entry for the kernel_cache key.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

DefaultUmask Property

Default file umask.

public Mono.Unix.Native.FilePermissions DefaultUmask { set; get; }

See Also

Value

A Mono.Unix.Native.FilePermissions instance containing the default file umask.

Remarks

This property can be set with the -o umask=M argument; it is 0 by default.

If this property is set then FileSystem.FuseOptions will have an entry for the umask key, the value of which is the umask.

The FileSystem.DefaultUmask value is applied to the Mono.Unix.Native.Stat.st_mode field returned by FileSystem.OnGetPathStatus and FileSystem.OnGetHandleStatus. This permits changing Mono.Unix.Native.Stat.st_mode for all files within the file system.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

DefaultUserId Property

Default file owner User ID.

public long DefaultUserId { set; get; }

See Also

Value

A long containing the default User ID.

Remarks

This property can be set with the -o uid=N argument; it is 0 by default.

If this property is set then FileSystem.FuseOptions will have an entry for the uid key, the value of which is the default User ID.

The FileSystem.DefaultUserId value is used as the Mono.Unix.Native.Stat.st_uid field value returned by FileSystem.OnGetPathStatus and FileSystem.OnGetHandleStatus when Mono.Unix.Native.Stat.st_uid is zero. This permits changing Mono.Unix.Native.Stat.st_uid for all files within the file system if it isn't otherwise set.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

DefaultGroupId Property

Default file owner Group ID.

public long DefaultGroupId { set; get; }

See Also

Value

A long containing the default Group ID.

Remarks

This property can be set with the -o gid=N argument; it is 0 by default.

If this property is set then FileSystem.FuseOptions will have an entry for the gid key, the value of which is the default Group ID.

The FileSystem.DefaultGroupId value is used as the Mono.Unix.Native.Stat.st_gid field value returned by FileSystem.OnGetPathStatus and FileSystem.OnGetHandleStatus when Mono.Unix.Native.Stat.st_gid is zero. This permits changing Mono.Unix.Native.Stat.st_gid for all files within the file system if it isn't otherwise set.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

PathTimeout Property

Cache timeout for path names.

public double PathTimeout { set; get; }

See Also

Value

A double containing the entry name timeout.

Remarks

This property can be set with the -o entry_timeout=T argument; it is 0.0 by default.

If this property is set then FileSystem.FuseOptions will have an entry for the entry_timeout key, the value of which is the entry timeout.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

DeletedPathTimeout Property

Cache timeout for deleted path names.

public double DeletedPathTimeout { set; get; }

See Also

Value

A double containing the deleted path timeout.

Remarks

This property can be set with the -o negative_timeout=T argument; it is 0.0 by default.

If this property is set then FileSystem.FuseOptions will have an entry for the negative_timeout key, the value of which is the deleted entry timeout.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

AttributeTimeout Property

Cache timeout for attributes.

public double AttributeTimeout { set; get; }

See Also

Value

A double containing the attribute timeout.

Remarks

This property can be set with the -o attr_timeout=T argument; it is 0.0 by default.

If this property is set then FileSystem.FuseOptions will have an entry for the attr_timeout key, the value of which is the default attribute timeout.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

MountPoint Property

The directory to mount the file system over.

public string MountPoint { set; get; }

See Also

Value

A string containing the directory to mount.

Remarks

This property must be set before calling FileSystem.Start, otherwise a Mono.Fuse.InvalidOperationException will be generated.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)

MultiThreaded Property

Controls whether FUSE will invoke Mono.Fuse.FileSystem methods in a multithreaded manner.

public bool MultiThreaded { set; get; }

Value

A bool specifying whether FUSE should invoke Mono.Fuse.FileSystem operations from multiple threads.

Remarks

This is true by default.

You can pass -s to FileSystem.ParseFuseArguments to disable multithreaded access, or set this property to false.

This property must be set before FileSystem.Start is invoked if multithreaded access needs to be disabled.

Requirements

Namespace: Mono.Fuse
Assembly: Mono.Fuse (in Mono.Fuse.dll)