fix #1581 - do not try to create an existing directory
avoid creating dir only if it is \".\"
Merge pull request #1582 from kumarshantanu/master

fix #1581 - do not try to create an existing directory