Struct LinuxPermissions
Manipulates Linux style file permissions.
Namespace: Neon.IO
Assembly: Neon.Common.dll
Syntax
public struct LinuxPermissions
Constructors
LinuxPermissions(string)
Constructs permissions from an octal string.
Declaration
public LinuxPermissions(string input)
Parameters
Type | Name | Description |
---|---|---|
string | input | The permissions string encoded in their octal form. |
Properties
AllExecute
Everyone can execute the file.
Declaration
public bool AllExecute { readonly get; set; }
Property Value
Type | Description |
---|---|
bool |
AllRead
Everyone can read the file.
Declaration
public bool AllRead { readonly get; set; }
Property Value
Type | Description |
---|---|
bool |
AllWrite
Everyone can modify the file.
Declaration
public bool AllWrite { readonly get; set; }
Property Value
Type | Description |
---|---|
bool |
GroupExecute
The group can execute the file.
Declaration
public bool GroupExecute { readonly get; set; }
Property Value
Type | Description |
---|---|
bool |
GroupRead
The group can read the file.
Declaration
public bool GroupRead { readonly get; set; }
Property Value
Type | Description |
---|---|
bool |
GroupWrite
The group can modify the file.
Declaration
public bool GroupWrite { readonly get; set; }
Property Value
Type | Description |
---|---|
bool |
OwnerExecute
The owner can execute the file.
Declaration
public bool OwnerExecute { readonly get; set; }
Property Value
Type | Description |
---|---|
bool |
OwnerRead
The owner can read the file.
Declaration
public bool OwnerRead { readonly get; set; }
Property Value
Type | Description |
---|---|
bool |
OwnerWrite
The owner can modify the file.
Declaration
public bool OwnerWrite { readonly get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
IsValidDigit(char)
Verifies that the character passed is a valid permissions digit.
Declaration
[Pure]
public static bool IsValidDigit(char digit)
Parameters
Type | Name | Description |
---|---|---|
char | digit | The permissions digit. |
Returns
Type | Description |
---|---|
bool |
|
Set(string, string, bool)
Sets the Linux file permissions.
Declaration
public static void Set(string path, string mode, bool recursive = false)
Parameters
Type | Name | Description |
---|---|---|
string | path | Path to the target file or directory. |
string | mode | Linux file permissions. |
bool | recursive | Optionally apply the permissions recursively. |
ToString()
Returns the fully qualified type name of this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | The fully qualified type name. |
Overrides
TryParse(string, out LinuxPermissions)
Attempts to parse permissions from an octal string.
Declaration
public static bool TryParse(string input, out LinuxPermissions permissions)
Parameters
Type | Name | Description |
---|---|---|
string | input | The input string. |
LinuxPermissions | permissions | Returns as the parsed permissions. |
Returns
Type | Description |
---|---|
bool |
|