Last active
August 29, 2015 14:04
-
-
Save Nzen/48f864bae7e1eb162ed6 to your computer and use it in GitHub Desktop.
CLI script prints the absolute path folder hierarchy and alternates with /* to catch the files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
def main() : | |
command = "sdelete.exe "# or "echo " for testing | |
folder_flag = "-r " | |
here = os.getcwd() | |
the_files = "\\*" | |
current = "" | |
for_bash = "" | |
for directory_tuple in os.walk( here, False ) : # top dir, start from top? | |
current = directory_tuple[0] # absolute path | |
if current == here : | |
return # else, I'll delete this script | |
# surround folder name to preserve spaces | |
for_bash = command + '\"' + current + the_files + '\"' | |
os.system( for_bash ) | |
for_bash = command + '\"' + current + '\"' | |
os.system( for_bash ) | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment