File.SetUnixFileMode 方法

定義

多載

SetUnixFileMode(String, UnixFileMode)

在指定路徑上設定檔案的指定 UnixFileMode

SetUnixFileMode(SafeFileHandle, UnixFileMode)

設定指定 UnixFileMode 之檔案句柄的 。

SetUnixFileMode(String, UnixFileMode)

來源:
File.cs
來源:
File.cs
來源:
File.cs

在指定路徑上設定檔案的指定 UnixFileMode

public:
 static void SetUnixFileMode(System::String ^ path, System::IO::UnixFileMode mode);
[System.Runtime.Versioning.UnsupportedOSPlatform("windows")]
public static void SetUnixFileMode (string path, System.IO.UnixFileMode mode);
[<System.Runtime.Versioning.UnsupportedOSPlatform("windows")>]
static member SetUnixFileMode : string * System.IO.UnixFileMode -> unit
Public Shared Sub SetUnixFileMode (path As String, mode As UnixFileMode)

參數

path
String

檔案的路徑。

mode
UnixFileMode

Unix 檔案模式。

屬性

例外狀況

path 是長度為零的字串,或包含一或多個無效的字元。 您可以使用 GetInvalidPathChars() 方法查詢無效字元。

pathnull

檔案模式無效。

呼叫端沒有必要的權限。

指定的路徑超過系統定義的最大長度。

path 元件不是目錄。

找不到檔案。

適用於

SetUnixFileMode(SafeFileHandle, UnixFileMode)

來源:
File.cs
來源:
File.cs
來源:
File.cs

設定指定 UnixFileMode 之檔案句柄的 。

public:
 static void SetUnixFileMode(Microsoft::Win32::SafeHandles::SafeFileHandle ^ fileHandle, System::IO::UnixFileMode mode);
[System.Runtime.Versioning.UnsupportedOSPlatform("windows")]
public static void SetUnixFileMode (Microsoft.Win32.SafeHandles.SafeFileHandle fileHandle, System.IO.UnixFileMode mode);
[<System.Runtime.Versioning.UnsupportedOSPlatform("windows")>]
static member SetUnixFileMode : Microsoft.Win32.SafeHandles.SafeFileHandle * System.IO.UnixFileMode -> unit
Public Shared Sub SetUnixFileMode (fileHandle As SafeFileHandle, mode As UnixFileMode)

參數

fileHandle
SafeFileHandle

檔案句柄。

mode
UnixFileMode

Unix 檔案模式。

屬性

例外狀況

檔案模式無效。

呼叫端沒有必要的權限。

檔案已關閉。

適用於