Mercurial > cpython-lru_cache-weakref
diff Tools/scripts/ftpmirror.py @ 8320:c14e68f591ce legacy-trunk
OK, here's a different way to implement the same thing -- this version
also supports filenames with multiple spaces in their name :-)
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 12 May 1998 22:45:43 +0000 |
| parents | df403ed35bdd |
| children | 2f43b61a98df |
line wrap: on
line diff
--- a/Tools/scripts/ftpmirror.py Tue May 12 22:36:11 1998 +0000 +++ b/Tools/scripts/ftpmirror.py Tue May 12 22:45:43 1998 +0000 @@ -132,17 +132,17 @@ infostuff = '' else: # Parse, assuming a UNIX listing - words = string.split(line) + words = string.split(line, None, 8) if len(words) < 6: if verbose > 1: print 'Skipping short line' continue - if words[-2] == '->': + filename = words[-1] + if string.find(filename, " -> ") >= 0: if verbose > 1: - print 'Skipping symbolic link %s -> %s' % \ - (words[-3], words[-1]) + print 'Skipping symbolic link %s' % \ + filename continue - filename = string.join(words[8:]) - infostuff = words[5:] + infostuff = words[-5:-1] mode = words[0] skip = 0 for pat in skippats:
