Problem with DirectoryIterator class under MAC


#1

Hi everyone,

 

I am using DirectoryIterator to search files and directories within a path. The code is as follows:

 


DirectoryIterator iter (File (file, false, "*.*", File::findFilesAndDirectories);
while (iter.next())
{
File theFileItFound (iter.getFile());
... etc

}

On Windows it works perfect but in MAC OSX it only finds hidden Files/Directories. I have also added the flag File::ignoreHiddenFiles but it does nothing.

I forgot to mention I am a MAC newbie.

Any help would be appreciated.

 

Thanks,

 

Oscar


#2

OSX doesn't use extensions in file names, so your search pattern will only find files that have a "." in them, including those which start with a "."

Try searching with just "*"


#3

Thanks Andrew,

 

That was the problem.

 

Regards,

 

Oscar