找回密码
 加入
搜索
查看: 4679|回复: 4

[BUG报告] 关于“FileFindNextFile”函数的“@extended”,还是BUG!

[复制链接]
发表于 2009-5-29 23:10:22 | 显示全部楼层 |阅读模式
本帖最后由 make2855 于 2009-6-4 19:09 编辑
; Shows the filenames of all files in the current directory
$search = FileFindFirstFile(@SystemDir & "\*.*")

; Check if the search was successful
If $search = -1 Then
        MsgBox(0, "Error", "No files/directories matched the search pattern")
        Exit
EndIf

While 1
        $file = FileFindNextFile($search)
        If @error Then ExitLoop
        If @extended Then
                MsgBox(4096, "Dir:", $file)
        Else
                MsgBox(4096, "File:", $file)
        EndIf
WEnd

; Close the search handle
FileClose($search)
第一个搜索到的不论是文件或者文件夹@extended都会返回0
不知道是BUG还是我理解错误?

===========================================
我又找到 “_FileListToArray.au3”,这可是官方写的,没错吧,我把路径改一下。
#Include <File.au3>
#Include <Array.au3>
$FileList=_FileListToArray(@systemDir,'*',1)
If @Error=1 Then
        MsgBox (0,"","No Files\Folders Found.")
        Exit
EndIf
_ArrayDisplay($FileList,"$FileList")
$FileList[1] 明明是目录来着!!!

===========================================
换台机器就可以了,看来是系统哪个地方没弄好,出了怪毛病。。。
===========================================
原来其实还是BUG,绝对是BUG,我换台机器了因为那台机器是封装的,所以第一个搜索到的是文件而不是文件夹,我甚至还到2003的服务器上面去测试,结果是一样的.
请thesnow这样测试:在c盘新建一个空文件夹,然后再在文件夹里面新建一个文件夹.然后再:
#Include <File.au3>
#Include <Array.au3>
$FileList=_FileListToArray('c:\新建文件夹','*',1)
If @Error=1 Then
        MsgBox (0,"","No Files\Folders Found.")
        Exit
EndIf
_ArrayDisplay($FileList,"$FileList")
这样搜索到的第一个文件就变成了文件夹,哈哈!!!
发表于 2009-6-2 23:15:20 | 显示全部楼层
我这里正常哇.
发表于 2009-6-3 08:28:17 | 显示全部楼层
我这里也正常哦,是否和环境有关系呢?
 楼主| 发表于 2009-6-3 13:44:03 | 显示全部楼层
对不起,我换了另外一个机器就可以了,这是为什么?
 楼主| 发表于 2009-6-4 19:08:46 | 显示全部楼层
本帖最后由 make2855 于 2009-6-4 19:10 编辑

原来其实还是BUG,绝对是BUG,我换台机器了因为那台机器是封装的,所以第一个搜索到的是文件而不是文件夹,我甚至还到2003的服务器上面去测试,结果是一样的.
请thesnow这样测试:在c盘新建一个空文件夹,然后再在文件夹里面新建一个文件夹.然后再:
#Include <File.au3>

#Include <Array.au3>

$FileList=_FileListToArray('c:\新建文件夹','*',1)

If @Error=1 Then

        MsgBox (0,"","No Files\Folders Found.")

        Exit

EndIf

_ArrayDisplay($FileList,"$FileList")
复制代码这样搜索到的第一个文件就变成了文件夹,哈哈!!!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-6 14:37 , Processed in 0.076734 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表