C# Класс 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.
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
AreHardlinked bool
CreateHardlink void
CreateSymlink void
GetFileSystem string
GetXattr byte[]
Rename void
SetXattr void

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

IsExecutable() публичный статический Метод

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.
Результат bool

IsRegularFile() публичный статический Метод

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 [
Результат bool

IsSymlink() публичный статический Метод

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.
Результат bool

IsSymlink() публичный статический Метод

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.
Результат bool

MakeReadOnly() публичный статический Метод

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.
Результат void

MakeWritable() публичный статический Метод

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.
Результат void

SetExecutable() публичный статический Метод

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.
Результат void