I'm writing a script in Python. The user has to enter a folder for the scrip to run on. There is some copying and moving of files and at a certain point a folder will be deleted. So, under no circumstances do I want this script to be run on the root folder. (or current or parent for that matter)
So I need to validate this. But how do I do that since "/" “./” “.” “..” etc .. as input are all perfectly valid and existing folders using os.path.isdir().
Should I manually check the input for these system folder symbols. Or is there a better way (existing function perhaps?) to check if the input is a real existing folder, but not a system or symbolic folder like (root, current, parent, etc …)