#969 closed Bug (Fixed)
FileFindNextFile @extended = 0 for folder $Recycle.Bin
| Reported by: | wraithdu | Owned by: | Jpm |
|---|---|---|---|
| Milestone: | 3.3.1.1 | Component: | AutoIt |
| Version: | 3.3.1.0 | Severity: | None |
| Keywords: | Win7 RC1 | Cc: |
Description
Win7 RC1, AutoIt 3.3.1.0
FileFindNextFile returns @extended = 0 (a file) for the hidden, system folder $Recycle.Bin when searching the root of the drive.
Ex. -
$hFind = FileFindFirstFile("C:\*.*")
While 1
$file = FileFindNextFile($hFind)
If @error Then ExitLoop
ConsoleWrite(@extended & " : " & FileGetAttrib("C:\" & $file) & " : " & $file & @CRLF)
WEnd
FileClose($hFind)
Attachments (0)
Change History (4)
comment:1 Changed 16 years ago by Jpm
- Keywords Win7 RC1 added
comment:2 Changed 16 years ago by Jpm
comment:3 Changed 16 years ago by Jpm
- Milestone set to 3.3.1.1
- Owner set to Jpm
- Resolution set to Fixed
- Status changed from new to closed
Fixed in version: 3.3.1.1
comment:4 Changed 16 years ago by wraithdu
I just wanted to add to this, in case the problem you fixed was specific to that directory. I put together a little script to do an extensive search to see if the problem was more widespread. I did a recursive search of my entire C: drive, and out of 121761 files and folders, 2820 folders were incorrectly identified as files by @extended. Again, just adding this as additional info.
BTW, this thing whipped through my whole HDD in ~40 seconds. Impressive speed!
Script -
#include <array.au3>
Dim $aErrors[1] = [0], $total = 0
_Find("C:")
_ArrayInsert($aErrors, 0, "Total Items: " & $total)
$aErrors[1] = "Total Errors: " & $aErrors[1]
_ArrayInsert($aErrors, 2, '@extended : attrib "D" : path')
_ArrayDisplay($aErrors)
Func _Find($path)
Local $hFind = FileFindFirstFile($path & "\*.*")
While 1
Local $item = FileFindNextFile($hFind)
If @error Then ExitLoop
Local $v1 = @extended
Local $v2 = StringInStr(FileGetAttrib($path & "\" & $item), "D")
If $v2 > 0 Then $v2 = 1
If $v1 <> $v2 Then
$aErrors[0] += 1
_ArrayAdd($aErrors, $v1 & " : " & $v2 & " : " & $path & "\" & $item)
EndIf
$total += 1
If $v2 Then _Find($path & "\" & $item) ; recurse directory
WEnd
FileClose($hFind)
EndFunc
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.

same thing is true under Vista