Snapshot always return success message [fix]

<code>realpath()</code> returned empty string & <code>fopen()</code> returned resource even if snapshot directory doesn't exists.
Modified realpath & added directory check.