SetFileAttributesΒΆ

SetFileAttributes sets file attributes.

bool = SetFileAttributes(ssFileName, nAttributes)

Return Value

If the function succeeds, the return value bool is TRUE (1); otherwise it is FALSE (0).

Parameters

ssFileName

ssFileName specifies the name of a file.

nAttributes

Specifies the file attributes to set for the file. This parameter can be a combination of the values below. However, all other values override FILE_NORMAL. The attributes can be one or more of the following values:

Value Meaning
FILE_READONLY The file or directory is read-only.
FILE_HIDDEN The file or directory is hidden.
FILE_SYSTEM The file or directory is used by the operating system.
FILE_DIRECTORY ssFileName is a directory.
FILE_ARCHIVE The file or directory is an archive file or directory.
FILE_NORMAL The file or directory has no other set attributes.

Example

SetFilesAttributes("d:/test.asc", FILE_READONLY | FILE_ARCHIVE);

id-262206