Checking file images

How to code for checking if file exists? like for example if an image in this specific folder existed?

in RGSS it was

Code:
 FileTest.exist?(dir)
Hum it's depend are u checking for a filename? or a specific file?
Im checking if a specific image exist or not. if not then it will skip that code to avoid errors.
rescue don't really exist in MV :/ 

you only have the option to make the people to not enable the specific file or check Mouse System Ex by Galenmereth it's have a method for the cursor
Here is a good explanation on how to do it: http://www.kirupa.com/html5/checking_if_a_file_exists.htm


@nio: You can use try-catch to catch exceptions.

Original thread: https://forums.rpgmakerweb.com/threads/checking-file-images.48546/