do not create un-needed files.

If $file doesn't end with a slash it's considered as a file, 
is_really_writable is creating a new file & leave it there when what you really want is checking if directory is writable.