Modify ↓
#2136 closed Bug (No Bug)
FileSetAttrib adds Archive attribute when System or Hidden attribs are set
| Reported by: | Owned by: | ||
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | 3.3.8.0 | Severity: | None |
| Keywords: | FileSetAttrib Hidden System Archive | Cc: |
Description
Example:
$sFile = @TempDir & '\Test.txt'
$hFile = FileOpen($sFile, 2)
FileWrite($hFile, 'Text')
FileClose($hFile)
FileSetAttrib($sFile, '+H')
;~ FileSetAttrib($sFile, '+S')
ConsoleWrite('-> Attrib = ' & FileGetAttrib($sFile) & @CRLF)
FileDelete($sFile)
Run this and you see that Archive attribute is added for some reason.
If we use attrib command from cmd.exe no extra attribs are added:
Run(@ComSpec & ' /C attrib +H "' & $sFile & '"', '', @SW_HIDE)
Attachments (0)
Change History (2)
comment:2 by , on Feb 18, 2012 at 5:19:32 PM
| Resolution: | → No Bug |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.

Sorry, it's not a bug, just realized it, when file created it's already have Archive attribute, so it's not related to FileSetAttrib:
$sFile = @TempDir & '\Test.txt' FileDelete($sFile) $hFile = FileOpen($sFile, 2) FileWrite($hFile, 'Text') FileClose($hFile) ConsoleWrite('-> Attrib After File Created = ' & FileGetAttrib($sFile) & @CRLF) FileSetAttrib($sFile, '-A') FileSetAttrib($sFile, '+H') ConsoleWrite('-> Attrib After FileSetAttrib(+H) = ' & FileGetAttrib($sFile) & @CRLF) FileDelete($sFile)