Edit

Share via


File.SetUnixFileMode Method

Definition

Overloads

SetUnixFileMode(SafeFileHandle, UnixFileMode)

Sets the specified UnixFileMode of the specified file handle.

SetUnixFileMode(String, UnixFileMode)

Sets the specified UnixFileMode of the file on the specified path.

SetUnixFileMode(SafeFileHandle, UnixFileMode)

Source:
File.cs
Source:
File.cs
Source:
File.cs

Sets the specified UnixFileMode of the specified file handle.

C#
[System.Runtime.Versioning.UnsupportedOSPlatform("windows")]
public static void SetUnixFileMode (Microsoft.Win32.SafeHandles.SafeFileHandle fileHandle, System.IO.UnixFileMode mode);

Parameters

fileHandle
SafeFileHandle

The file handle.

mode
UnixFileMode

The Unix file mode.

Attributes

Exceptions

The file mode is invalid.

The caller does not have the required permission.

The file is closed.

Applies to

.NET 9 and other versions
Product Versions
.NET 7, 8, 9

SetUnixFileMode(String, UnixFileMode)

Source:
File.cs
Source:
File.cs
Source:
File.cs

Sets the specified UnixFileMode of the file on the specified path.

C#
[System.Runtime.Versioning.UnsupportedOSPlatform("windows")]
public static void SetUnixFileMode (string path, System.IO.UnixFileMode mode);

Parameters

path
String

The path to the file.

mode
UnixFileMode

The Unix file mode.

Attributes

Exceptions

path is a zero-length string, or contains one or more invalid characters. You can query for invalid characters by using the GetInvalidPathChars() method.

path is null.

The file mode is invalid.

The caller does not have the required permission.

The specified path exceeds the system-defined maximum length.

A component of the path is not a directory.

The file cannot be found.

Applies to

.NET 9 and other versions
Product Versions
.NET 7, 8, 9