def filename2pathlist(path, skipfirst=False):
 h = path
 l = []
 while True:
  (h, t) = os.path.split(h)
  if ((h == '') and (t == '')):
   break
  if ((h == '') and skipfirst):
   continue
  if (t != ''):
   l.append(t)
 l.reverse()
 return l

def filename2pathlist ( path , skipfirst = False ) : h = path l = [ ] while True : ( h , t ) = os . path . split ( h ) if ( ( h == '' ) and ( t == '' ) ) : break if ( ( h == '' ) and skipfirst ) : continue if ( t != '' ) : l . append ( t ) l . reverse ( ) return l
convert a filename to a path entry suitable for a multi-file torrent file .