Code: Select all
if ExamineDirectory(0, GetCurrentDirectory(), "fake.txt")
While NextDirectoryEntry(0)
Debug DirectoryEntryName(0)
Wend
FinishDirectory(0)
EndIf
Code: Select all
if ExamineDirectory(0, GetCurrentDirectory(), "fake.txt")
While NextDirectoryEntry(0)
Debug DirectoryEntryName(0)
Wend
FinishDirectory(0)
EndIf
nope! I said that ExamineDirectory always returns positive value (<> 0) for any patterns in existing folder.Bisonte wrote:that is the correct behaviour.
ExamineDirectory returns a value <> 0 IF the directory can be examined...
That has nothing to do with the pattern....
If the directory in your example not exist... it returns 0...
Code: Select all
result = ExamineDirectory(0, GetCurrentDirectory(), "not_existing_file.txt")
; "*.txt" pattern will also receive wrong result if no txt files in the folder
Debug Str(result) ; will print positive value more than 0
So what?rvrom wrote:I said that ExamineDirectory always returns positive value (<> 0) for any patterns in existing folder.
Bisonte wrote:that is the correct behaviour.
ExamineDirectory returns a value <> 0 IF the directory can be examined...
That has nothing to do with the pattern....
If the directory in your example not exist... it returns 0...
@rvrom: I have verified what you said is true. It also matches exactly what is said in the help file and exactly matches Bisonte's re-statement of the help file 'that it has nothing to do with the pattern'.rvrom wrote:nope! I said that ExamineDirectory always returns positive value (<> 0) for any patterns in existing folder.
please verify.
Not a bug.PureBasic Help File -- ExamineDirectory wrote:Returns nonzero if the directory can be enumerated or zero if there was an error.
Yep. I'm agree. This is not a bug. I was confusing by Kale's comment:Little John wrote: So what?
...
No bug.