Added function to check for directory existence
Fixed access-denied issues
Handle situation correctly when directory does not exist
add string formatting function
handle situtions of missing directories better
handle situation of missing directories better
fixed memory leak
not smart enough to think of a smart comment
Fixes
Preliminary changes - don't use yet