# Set a path to different data folder

**URL:** <https://discourse.processing.org/t/set-a-path-to-different-data-folder/12021>\
**Category:** Coding Questions\
**Created:** [June 12, 2019, 1:38pm UTC](https://discourse.processing.org/t/set-a-path-to-different-data-folder/12021 "2019-06-12T13:38:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![OptOut](https://avatars.discourse-cdn.com/v4/letter/o/cc9497/32.png) [@OptOut](https://discourse.processing.org/u/OptOut)\
**Post date:** [June 12, 2019, 1:38pm UTC](https://discourse.processing.org/t/set-a-path-to-different-data-folder/12021/1 "2019-06-12T13:38:15Z")

</div>

Hi everybody,

I have two different sets of images that I need to keep separate. I have one set of images in the regular data folder. I am selecting these images by putting them in an array

`PImage[] images = new PImage[maxImages];`

Which works fine.

However, the second bath of images are in a folder called data2.

I need to also put them into a separate array.

Can anyone please tell the best way to this (if is possible?)

Thanks,

Opt Out

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 12, 2019, 2:04pm UTC](https://discourse.processing.org/t/set-a-path-to-different-data-folder/12021/2 "2019-06-12T14:04:07Z")

</div>

Use my code example from here:

> [@File Listing Order](https://discourse.processing.org/t/file-listing-order/7148/41):
>
> [Docs.Oracle.com/en/java/javase/11/docs/api/java.base/java/util/Arrays.html#sort(java.lang.Object[])](http://Docs.Oracle.com/en/java/javase/11/docs/api/java.base/java/util/Arrays.html#sort(java.lang.Object%5B%5D)) static final String PICS\_EXTS = "extensions=,png,jpg,jpeg,gif,tif,tiff,tga,bmp,wbmp"; static final float FPS = .25; PImage[] images; void setup() { size(1200, 600); frameRate(FPS); imageMode(CENTER); final File dir = dataFile(""); println(dir); String[] imagePaths = {}; int imagesFound = 0; if (dir.isDirectory()) { imagePaths = listPaths(dir.getPath(), "files", "recursi…

But replace `final File dir = dataFile("");` w/ `final File dir = sketchFile("data2");`

---

<div class="post-metadata">

**Author:** ![OptOut](https://avatars.discourse-cdn.com/v4/letter/o/cc9497/32.png) [@OptOut](https://discourse.processing.org/u/OptOut)\
**Post date:** [June 15, 2019, 10:44am UTC](https://discourse.processing.org/t/set-a-path-to-different-data-folder/12021/3 "2019-06-15T10:44:27Z")

</div>

Thanks GoToLoop will give it a try!

---

<div class="post-metadata">

**Author:** ![tribblesontoast](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tribblesontoast](https://discourse.processing.org/u/tribblesontoast)\
**Post date:** [June 20, 2019, 10:20am UTC](https://discourse.processing.org/t/set-a-path-to-different-data-folder/12021/4 "2019-06-20T10:20:49Z")

</div>

How about this:

```
sketchPath("data2/")
```
