FileSystemInfo.UnixFileMode 属性

定义

获取或设置当前文件或目录的 Unix 文件模式。

C#
public System.IO.UnixFileMode UnixFileMode { get; [System.Runtime.Versioning.UnsupportedOSPlatform("windows")] set; }

属性值

当前 UnixFileModeFileSystemInfo

属性

例外

文件模式无效。

调用方没有所要求的权限。

指定路径的长度超出系统定义的最大长度。

指定路径无效。 仅在设置属性值时引发。

指定的文件不存在。 仅在设置属性值时引发。

Refresh() 不能初始化数据。

注解

当访问值本身或其他 FileSystemInfo 属性时,可能会缓存该值。 若要获取最新值,请调用 Refresh() 方法。

如果自上次缓存状态起路径不存在,则返回值为 (UnixFileMode)(-1)FileNotFoundExceptionDirectoryNotFoundException 只能在设置值时引发。

适用于

产品 版本
.NET 7, 8, 9