Modify

Opened 8 years ago

Closed 8 years ago

#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 Changed 8 years ago by MrCreatoR <mscreator@…>

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 Changed 8 years ago by Jpm

  • Resolution set to No Bug
  • Status changed from new to closed

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.