# .dat file does not exist

**URL:** <https://discourse.processing.org/t/dat-file-does-not-exist/4651>\
**Category:** Coding Questions\
**Created:** [October 19, 2018, 4:52pm UTC](https://discourse.processing.org/t/dat-file-does-not-exist/4651 "2018-10-19T16:52:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rva1945](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@rva1945](https://discourse.processing.org/u/rva1945)\
**Post date:** [October 19, 2018, 4:52pm UTC](https://discourse.processing.org/t/dat-file-does-not-exist/4651/1 "2018-10-19T16:52:05Z")

</div>

Is there anyway of checking of the file exists prior to loadBytes()? Inicially the file does not exist and the sketch stops.

Thanks

---

<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:** [October 19, 2018, 5:01pm UTC](https://discourse.processing.org/t/dat-file-does-not-exist/4651/2 "2018-10-19T17:01:46Z")

</div>

> [@How to check if a file is exist in data folder by code?](https://discourse.processing.org/t/how-to-check-if-a-file-is-exist-in-data-folder-by-code/589/2):
>
> File f = dataFile("DoIExist.txt"); String filePath = f.getPath(); boolean exist = f.isFile(); println(filePath, exist);

---

<div class="post-metadata">

**Author:** ![rva1945](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@rva1945](https://discourse.processing.org/u/rva1945)\
**Post date:** [October 19, 2018, 8:48pm UTC](https://discourse.processing.org/t/dat-file-does-not-exist/4651/3 "2018-10-19T20:48:40Z")

</div>

Great, Many thanks!!
