def create_files(paths, chroot):
 (dirs, files) = (set(), set())
 for path in paths:
  path = osp.join(chroot, path)
  filename = osp.basename(path)
  if (filename == ''):
   dirs.add(path)
  else:
   dirs.add(osp.dirname(path))
   files.add(path)
 for dirpath in dirs:
  if (not osp.isdir(dirpath)):
   os.makedirs(dirpath)
 for filepath in files:
  open(filepath, 'w').close()

def create_files ( paths , chroot ) : ( dirs , files ) = ( set ( ) , set ( ) ) for path in paths : path = osp . join ( chroot , path ) filename = osp . basename ( path ) if ( filename == '' ) : dirs . add ( path ) else : dirs . add ( osp . dirname ( path ) ) files . add ( path ) for dirpath in dirs : if ( not osp . isdir ( dirpath ) ) : os . makedirs ( dirpath ) for filepath in files : open ( filepath , 'w' ) . close ( )
creates directories and files found in <path> .