4. Deleting and creating temp directory hierarchy.

#target can be folders hierarchy (d:\\folderA/folderB\\folderC/folderD)
def RecreateEmptyFolder(target)
FileUtils.rm_rf(target, :verbose=>true) if (Dir[target] != [] and Dir[target] != nil )
#make sure no other process is holding the folder
#sometimes will fail as if rm_rf still not finished while mkdir_p is working
sleep 3
FileUtils.mkdir_p target , :verbose=>true
end