Function to auto generate the new folder name.
Function to check whether path is directory ( folder ) or not ( file or something else ) .