# Sampler files path locations - OS X + Windows

**URL:** <https://forum.juce.com/t/sampler-files-path-locations-os-x-windows/49668>\
**Category:** General JUCE discussion\
**Created:** [January 14, 2022, 7:28am UTC](https://forum.juce.com/t/sampler-files-path-locations-os-x-windows/49668 "2022-01-14T07:28:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skyleryoung](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@Skyleryoung](https://forum.juce.com/u/Skyleryoung)\
**Post date:** [January 14, 2022, 7:28am UTC](https://forum.juce.com/t/sampler-files-path-locations-os-x-windows/49668/1 "2022-01-14T07:28:19Z")

</div>

Hi!

I have made a sampler plugin that reads .wav files from the drive. The path im using for Mac OS X is:  
`File::getSpecialLocation(File::SpecialLocationType::commonApplicationDataDirectory).getChildFile("Application Support").getChildFile("Company").getChildFile("File"))`.

Is this a correct path to use? Also, what path do I use for Windows? Im assuming not the same one.

Do I check what operating system to use in the code? Or export different versions with their own paths for each?

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [January 14, 2022, 10:26am UTC](https://forum.juce.com/t/sampler-files-path-locations-os-x-windows/49668/2 "2022-01-14T10:26:55Z")

</div>

Yes, that is a sensible choice. With the exception that for Windows you skip the “Application Support” part:

```auto
File::getSpecialLocation(File::SpecialLocationType::commonApplicationDataDirectory)
#if JUCE_MAC
    .getChildFile("Application Support")
#endif
    .getChildFile("Company").getChildFile("File"));

```

The if JUCE\_MAC is evaluated by the preprocessor at compile time, since the build will always only run on the machine it was compiled for.

---

<div class="post-metadata">

**Author:** ![Skyleryoung](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@Skyleryoung](https://forum.juce.com/u/Skyleryoung)\
**Post date:** [January 15, 2022, 1:21am UTC](https://forum.juce.com/t/sampler-files-path-locations-os-x-windows/49668/3 "2022-01-15T01:21:42Z")

</div>

Thank you! Exactly what I was looking for!
