Modify

#2136 closed Bug (No Bug)

FileSetAttrib adds Archive attribute when System or Hidden attribs are set

Reported by: MrCreatoR <mscreator@…> 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:1 by MrCreatoR <mscreator@…>, on Feb 18, 2012 at 12:51:22 PM

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)

comment:2 by J-Paul Mesnage, on Feb 18, 2012 at 5:19:32 PM

Resolution: No Bug
Status: newclosed

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.