# Check if file exists or not

**URL:** <https://discourse.processing.org/t/check-if-file-exists-or-not/39317>\
**Category:** Beginners\
**Created:** [October 17, 2022, 12:17pm UTC](https://discourse.processing.org/t/check-if-file-exists-or-not/39317 "2022-10-17T12:17:03Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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 17, 2022, 4:34pm UTC](https://discourse.processing.org/t/check-if-file-exists-or-not/39317/4 "2022-10-17T16:34:08Z")

</div>

> [@jensemand](#):
>
> Is there any simple way to check whether a file exists without getting this kind of error message?

Check `if (!dataFile(name).isFile()) table = createAndSaveTableFile(name);`  
at file “Card\_Functions.pde” within function **loadCards():**

> [@The operator \> is undefined for the argument - HOW TO RESOLVE ERROR (OOP)](https://discourse.processing.org/t/the-operator-is-undefined-for-the-argument-how-to-resolve-error-oop/38705/6#card_functionspde-3):
>
> If you wish you can take a look at a very old deck of cards implementation I did a long time ago: [Picking cards at random, then excluding those from further picking. - Processing 2.x and 3.x Forum](https://forum.Processing.org/two/discussion/2801/picking-cards-at-random-then-excluding-those-from-further-picking-#Item_2) It’s split into 2 sketches: 1 creates & saves the “.csv” file, while the other loads it and makes a deck of cards out of it. For convenience I’ve merged them now into 1 sketch w/ 4 “.pde” tabs: “Table\_CSV\_Card\_Pack.pde”: /\*\* \* Table CSV Card Pack (v1.0.1) \* by GoToLoop (2022/Sep/13) \* \* htt…

---

_[View the full topic](https://discourse.processing.org/t/check-if-file-exists-or-not/39317)._
