# Access many files from a directory in p5

**URL:** <https://discourse.processing.org/t/access-many-files-from-a-directory-in-p5/2186>\
**Category:** Coding Questions\
**Created:** [July 29, 2018, 8:16pm UTC](https://discourse.processing.org/t/access-many-files-from-a-directory-in-p5/2186 "2018-07-29T20:16:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AFNordal](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@AFNordal](https://discourse.processing.org/u/AFNordal)\
**Post date:** [July 29, 2018, 8:16pm UTC](https://discourse.processing.org/t/access-many-files-from-a-directory-in-p5/2186/1 "2018-07-29T20:16:40Z")

</div>

Is there a way of accessing many files without hard-coding their names manually (or having their names be “1.txt”,“2.txt”,“3.txt”,“4.txt”…)? In processing you would use file.list(), but as far as I know this doesn’t exist in p5?

---

<div class="post-metadata">

**Author:** ![AFNordal](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@AFNordal](https://discourse.processing.org/u/AFNordal)\
**Post date:** [July 29, 2018, 9:20pm UTC](https://discourse.processing.org/t/access-many-files-from-a-directory-in-p5/2186/2 "2018-07-29T21:20:59Z")

</div>

I found a fix: I made processing sketch that uses file.list() to put all the string names of the files into a text file, which can be accessed from p5, which then can use these strings to access the files.
