The first example shows a simple script that opens a text file:
If the file does not exist you might get an error like this:
To prevent the user from getting an error message like the one above, we test whether the file exist before we try to access it: