# How to check if a file is exist in data folder by code?

**URL:** <https://discourse.processing.org/t/how-to-check-if-a-file-is-exist-in-data-folder-by-code/589>\
**Category:** Processing.py\
**Created:** [June 1, 2018, 4:03am UTC](https://discourse.processing.org/t/how-to-check-if-a-file-is-exist-in-data-folder-by-code/589 "2018-06-01T04:03:18Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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 1, 2018, 4:09am UTC](https://discourse.processing.org/t/how-to-check-if-a-file-is-exist-in-data-folder-by-code/589/2 "2018-06-01T04:09:11Z")

</div>

```auto
File f = dataFile("DoIExist.txt");
String filePath = f.getPath();
boolean exist = f.isFile();
println(filePath, exist);

```

---

_[View the full topic](https://discourse.processing.org/t/how-to-check-if-a-file-is-exist-in-data-folder-by-code/589)._
