Is this a bug of TFindFile class?

Login to reply to this topic.
Tue, 2007-07-10 12:24
Joined: 2006-07-26
Forum posts: 27

My folder structure is like this:

C:\a.txt
C:\test\b.txt

When I do TFindFile ::FindWildByPath( _L("*.txt"), &_L("C:\\test\\"), iDir );
What I got is a.txt rather than b.txt.

I can only get b.txt by calling FindWild() afterwards. According to the SDK doc, the explaination of this function is like "Searches for one or more files in the directories contained in a path list.", but "C:\" is not in the list.

What's more strange is if my folder structure is like:

C:\test\a.txt
C:\test\test\b.txt
(there's no .txt file in C:\)

And I do TFindFile ::FindWildByPath( _L("*.txt"), &_L("C:\\test\\test\\"), iDir );
I will get b.txt, which is right. So I suspect it's a bug.

What do you think, thanks.
BR
Jimmy


Taking you forward.


Tue, 2007-07-10 12:47
Joined: 2003-09-22
Forum posts: 27
Re: Is this a bug of TFindFile class?

try loosing the ending "\\" in _L("C:\\test\\")

Wed, 2007-07-11 04:23
Joined: 2006-07-26
Forum posts: 27
Re: Is this a bug of TFindFile class?

I tried, it's the same. However, in SDK doc,

const TDesC *aPathList :
List of directories to search. Paths in this list must be separated by a semicolon character, but a semicolon is not required after the final path. The directories are searched in the order in which they occur in the list. Directories must be fully qualified, including a drive letter, and the name must end with a backslash.


Taking you forward.

Wed, 2007-07-11 10:39
Joined: 2004-05-24
Forum posts: 981
Re: Is this a bug of TFindFile class?

Strange...what sdk are you using there?
TFindFile ::FindWildByPath should give same results as RFs::GetDir().
Can you try the last one (for your first use case)


pirosl

  • Login to reply to this topic.