# Problem with DirectoryIterator class under MAC

**URL:** <https://forum.juce.com/t/problem-with-directoryiterator-class-under-mac/13537>\
**Category:** General JUCE discussion\
**Created:** [September 10, 2014, 11:53am UTC](https://forum.juce.com/t/problem-with-directoryiterator-class-under-mac/13537 "2014-09-10T11:53:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oscar1771](https://avatars.discourse-cdn.com/v4/letter/o/6bbea6/32.png) [@Oscar1771](https://forum.juce.com/u/Oscar1771)\
**Post date:** [September 10, 2014, 11:53am UTC](https://forum.juce.com/t/problem-with-directoryiterator-class-under-mac/13537/1 "2014-09-10T11:53:47Z")

</div>

Hi everyone,

&nbsp;

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

&nbsp;

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

}
```

On Windows it works perfect but in MAC OSX&nbsp;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.

&nbsp;

Thanks,

&nbsp;

Oscar

---

<div class="post-metadata">

**Author:** ![andrewj](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/andrewj/32/13428_2.png) [@andrewj](https://forum.juce.com/u/andrewj)\
**Post date:** [September 10, 2014, 12:29pm UTC](https://forum.juce.com/t/problem-with-directoryiterator-class-under-mac/13537/2 "2014-09-10T12:29:00Z")

</div>

OSX doesn't use&nbsp;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 "\*"

---

<div class="post-metadata">

**Author:** ![Oscar1771](https://avatars.discourse-cdn.com/v4/letter/o/6bbea6/32.png) [@Oscar1771](https://forum.juce.com/u/Oscar1771)\
**Post date:** [September 10, 2014, 1:15pm UTC](https://forum.juce.com/t/problem-with-directoryiterator-class-under-mac/13537/3 "2014-09-10T13:15:49Z")

</div>

Thanks Andrew,

&nbsp;

That was the problem.

&nbsp;

Regards,

&nbsp;

Oscar
