fixed some style issues ( if( --> if (, foreach( --> foreach ( )
if an object is a directory it's existent
overwriting existing files is valid when copying a file
overwriting existing files while renaming a file is valid