Skip to content

Instantly share code, notes, and snippets.

@cquest
Created August 19, 2017 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cquest/1c9b4c1916dcab54c1e3a57fe3f4df47 to your computer and use it in GitHub Desktop.
Save cquest/1c9b4c1916dcab54c1e3a57fe3f4df47 to your computer and use it in GitHub Desktop.
import sys
f = open(sys.argv[1],'r')
lines = f.readlines()
directory = ['','','','','','','','']
prefix = ''
for l in lines[1:-2]:
n = l.lstrip()
level = (len(l)-len(n))/2
i = n.split(' ')
if i[1]=='DIR':
directory[level] = i[0]
else:
if level>0:
print('mkdir -p hdd/%s ; ./ac.sh -g ../HDD.hdv %s hdd/%s' % ('/'.join(directory[0:level]), '/'+'/'.join(directory[0:level])+'/'+i[0], '/'.join(directory[0:level])+'/'+i[0]))
else:
print('./ac.sh -g ../HDD.hdv %s hdd/%s' % (i[0],i[0]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment