C# Class NanoByte.Common.Native.UnixUtils

Provides helper methods for Unix-specific features of the Mono library.
This class has a dependency on Mono.Posix. Make sure to check IsUnix before calling any other methods in this class to avoid missing assembly exceptions.
Afficher le fichier Open project: nano-byte/common

Private Properties

Свойство Type Description
AreHardlinked bool
CreateHardlink void
CreateSymlink void
GetFileSystem string
GetXattr byte[]
Rename void
SetXattr void

Méthodes publiques

Méthode Description
IsExecutable ( [ path ) : bool

Checks whether a file is marked as Unix-executable.

Will return false for non-existing files.

IsRegularFile ( [ path ) : bool

Checks whether a file is a regular file (i.e. not a device file, symbolic link, etc.).

Will return false for non-existing files.

IsSymlink ( [ path ) : bool

Checks whether a file is a Unix symbolic link.

Will return false for non-existing files.

IsSymlink ( [ path, string &target ) : bool

Checks whether a file is a Unix symbolic link.

MakeReadOnly ( [ path ) : void

Removes write permissions for everyone on a filesystem object (file or directory).

MakeWritable ( [ path ) : void

Sets write permissions for the owner on a filesystem object (file or directory).

SetExecutable ( [ path, bool executable ) : void

Marks a file as Unix-executable or not Unix-executable.

Private Methods

Méthode Description
AreHardlinked ( [ path1, [ path2 ) : bool
CreateHardlink ( [ sourcePath, [ targetPath ) : void
CreateSymlink ( [ sourcePath, [ targetPath ) : void
GetFileSystem ( [ path ) : string
GetXattr ( [ path, [ name ) : byte[]
Rename ( [ source, [ destination ) : void
SetXattr ( [ path, [ name, [ data ) : void

Method Details

IsExecutable() public static méthode

Checks whether a file is marked as Unix-executable.
Will return false for non-existing files.
The underlying Unix subsystem failed to process the request (e.g. because of insufficient rights). The underlying Unix subsystem failed to process the request (e.g. because of insufficient rights).
public static IsExecutable ( [ path ) : bool
path [ The file to check for executable rights.
Résultat bool

IsRegularFile() public static méthode

Checks whether a file is a regular file (i.e. not a device file, symbolic link, etc.).
Will return false for non-existing files.
The underlying Unix subsystem failed to process the request (e.g. because of insufficient rights). The underlying Unix subsystem failed to process the request (e.g. because of insufficient rights).
public static IsRegularFile ( [ path ) : bool
path [
Résultat bool

IsSymlink() public static méthode

Checks whether a file is a Unix symbolic link.
Will return false for non-existing files.
The underlying Unix subsystem failed to process the request (e.g. because of insufficient rights). The underlying Unix subsystem failed to process the request (e.g. because of insufficient rights).
public static IsSymlink ( [ path ) : bool
path [ The path of the file to check.
Résultat bool

IsSymlink() public static méthode

Checks whether a file is a Unix symbolic link.
The underlying Unix subsystem failed to process the request (e.g. because of insufficient rights). The underlying Unix subsystem failed to process the request (e.g. because of insufficient rights).
public static IsSymlink ( [ path, string &target ) : bool
path [ The path of the file to check.
target string Returns the target the symbolic link points to if it exists.
Résultat bool

MakeReadOnly() public static méthode

Removes write permissions for everyone on a filesystem object (file or directory).
The underlying Unix subsystem failed to process the request (e.g. because of insufficient rights). The underlying Unix subsystem failed to process the request (e.g. because of insufficient rights).
public static MakeReadOnly ( [ path ) : void
path [ The filesystem object (file or directory) to make read-only.
Résultat void

MakeWritable() public static méthode

Sets write permissions for the owner on a filesystem object (file or directory).
The underlying Unix subsystem failed to process the request (e.g. because of insufficient rights). The underlying Unix subsystem failed to process the request (e.g. because of insufficient rights).
public static MakeWritable ( [ path ) : void
path [ The filesystem object (file or directory) to make writeable by the owner.
Résultat void

SetExecutable() public static méthode

Marks a file as Unix-executable or not Unix-executable.
The underlying Unix subsystem failed to process the request (e.g. because of insufficient rights). The underlying Unix subsystem failed to process the request (e.g. because of insufficient rights).
public static SetExecutable ( [ path, bool executable ) : void
path [ The file to mark as executable or not executable.
executable bool true to mark the file as executable, true to mark it as not executable.
Résultat void