Sets the attributes for a file or directory.
SetFileAttributes(cFileName, nAttributes)
Parameters
- cFileName
The name of the file for which to set the attributes.
Note
- nAttributes (additional)
One or a combination of the following values. Attribute Description FILE_ATTRIBUTE_ARCHIVE A file or directory that is an archive file or directory. Applications typically use this attribute to mark files for backup or removal. FILE_ATTRIBUTE_HIDDEN The file or directory is hidden. It is not included in an ordinary directory listing. FILE_ATTRIBUTE_NORMAL A file that does not have other attributes set. This attribute is valid only when used alone. FILE_ATTRIBUTE_NOT_CONTENT_INDEXED The file or directory is not to be indexed by the content indexing service. FILE_ATTRIBUTE_OFFLINE The data of a file is not available immediately. This attribute indicates that the file data is physically moved to offline storage. This attribute is used by Remote Storage, which is the hierarchical storage management software. Applications should not arbitrarily change this attribute. FILE_ATTRIBUTE_READONLY A file that is read-only. Applications can read the file, but cannot write to it or delete it. This attribute is not honored on directories. FILE_ATTRIBUTE_SYSTEM A file or directory that the operating system uses a part of, or uses exclusively. FILE_ATTRIBUTE_TEMPORARY A file that is being used for temporary storage. File systems avoid writing data back to mass storage if sufficient cache memory is available, because typically, an application deletes a temporary file after the handle is closed. In that scenario, the system can entirely avoid writing the data. Otherwise, the data is written after the handle is closed.
Return Value
Always .T.
See Also
Reference
ADirectoryInfo
ADirEx
ADriveInfo
AFileAttributes
AFileAttributesEx
CancelFileChange
CompareFileTimes
CopyFileEx
DeleteDirectory
DeleteFileEx
FindFileChange
GetFileAttributes
GetFileOwner
GetFileSize
GetFileTimes
GetLongPathName
GetShortPathName
MoveFileEx
SetFileTimes