Code:
def dir_list_folder(head_dir, dir_name):
dir_list = []
cmd = "cd " + head_dir + " && find . -type d -name " + dir_name + " > /tmp/temp.txt && cd - "
(status, output) = commands.getstatusoutput(cmd)
if status != 0:
print "Error : Failed to execute cmd : " + cmd
fp = open("/tmp/temp.txt")
Leave a comment: