Check to see if a directory exitst
if (-d "<PATH OF FILE>")
Check to see if a file exists
if( -e "<PATH OF FILE>")