# 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:** 6

<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, 5:17am UTC](https://discourse.processing.org/t/how-to-check-if-a-file-is-exist-in-data-folder-by-code/589/6 "2018-06-01T05:17:03Z")

</div>

> [@newton45](#):
>
> … how to achieve that in Python Mode if possible?

```auto
f = this.dataFile('DoIExist.txt')
filePath, exist = f.path, f.isFile()
print 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)._
