文件特性常量File Attribute Constants

语法Syntax


#include <io.h>  

备注Remarks

这些常量指定由函数指定的文件或目录的当前特性。These constants specify the current attributes of the file or directory specified by the function.

特性可以通过以下清单常量表示:The attributes are represented by the following manifest constants:

_A_ARCH
存档。Archive. 每当通过 BACKUP 命令更改或清除文件时进行设置。Set whenever the file is changed, and cleared by the BACKUP command. 值:0x20Value: 0x20

_A_HIDDEN
隐藏文件。Hidden file. 使用 DIR 命令时通常不可见,除非使用 /AH 选项。Not normally seen with the DIR command, unless the /AH option is used. 返回常规文件和具有此特性的文件的相关信息。Returns information about normal files as well as files with this attribute. 值:0x02Value: 0x02

_A_NORMAL
正常。Normal. 可以不受限制地读取或写入的文件。File can be read or written to without restriction. 值:0x00Value: 0x00

_A_RDONLY
只读。Read-only. 无法打开文件进行写入且无法创建具有相同名称的文件。File cannot be opened for writing, and a file with the same name cannot be created. 值:0x01Value: 0x01

_A_SUBDIR
子目录。Subdirectory. 值:0x10Value: 0x10

_A_SYSTEM
系统文件。System file. 使用 DIR 命令时通常不可见,除非使用 /AS 选项。Not normally seen with the DIR command, unless the /AS option is used. 值:0x04Value: 0x04

可以使用 OR 运算符 (|) 组合多个常量。Multiple constants can be combined with the OR operator (|).

另请参阅See Also

文件名搜索函数 Filename Search Functions
全局常量Global Constants