File tests 

if ( $path->exists )  { ... }

if ( $path->is_file ) { ... }

if ( $path->is_dir )  { ... }