cbpporter Messages: 1401 Registered: September 2007
Ultimate Contributor
While porting my applications to Linux I noticed a very strange bug: some files where missing when iterating over folders. After some investigation, it turns out that I've been using FindFile wrong since forever.
I kept wrting loops like this:
FindFile ff("");
while (ff.Next())
DUMP(ff.GetPath());
This is wrong since it jump over the first file in the folder. On Windows this is not an issue since the first file is always ".." or ".", but under Linux I was missing real important files.
The correct way to write the loop is:
FindFile ff("");
while (ff) {
DUMP(ff.GetPath());
ff.Next();
}
Now I need to search for FindFile in all projects ever .