Jump to content

not searching all directory's?


Recommended Posts

how is it possible that the following isn't working correctly?

Func idx($dir)
    $contents=FileFindFirstFile($dir&'\*')
    While 1
        $content=FileFindNextFile($contents)
        If @error Then ExitLoop
        $names&=$content&'|'
        $dirs&=$dir&'|'
        If FileGetAttrib($dir&'\'&$content)='D' Then
            If Not StringInStr($dir,'\') Then
                MsgBox(0,'dir',$dir&'\'&$content)
            EndIf
            idx($dir&'\'&$content)
        EndIf
    WEnd
    FileClose($contents)
EndFunc
thanks to that msgbox() I know that it only searches:

- c:\windows

on the c drive and

- d:\Documents and settings

- d:\Windows

on the d drive.

while I have other directory's on both drives...

Link to comment
Share on other sites

I don't see an edit-button, maybe because its the first post in a topic...

I've tested it on a diverend notebook, wich has windows XP, here it works...

I have windows Vista.

Someone know a solution?

Edited by dNino
Link to comment
Share on other sites

"If FileGetAttrib($dir&'\'&$content)='D' Then" is a problem. It should be more like...

If StringInStr(FileGetAttrib($dir&'\'&$content), 'D') Then

edit -

Just to clarify, the reason to do it like that is because, say a directory is also read only and maybe set to archive, then FileGetAttrib will return something like 'RAD.'

Edited by xcal
Link to comment
Share on other sites

"If FileGetAttrib($dir&'\'&$content)='D' Then" is a problem. It should be more like...

If StringInStr(FileGetAttrib($dir&'\'&$content), 'D') Then

edit -

Just to clarify, the reason to do it like that is because, say a directory is also read only and maybe set to archive, then FileGetAttrib will return something like 'RAD.'

Thank you, it's working :whistle:
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...