summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-05-12 22:45:43 (GMT)
committerGuido van Rossum <guido@python.org>1998-05-12 22:45:43 (GMT)
commit1f05cb007a12f018183630df6dc1e82fb472b8a3 (patch)
tree06c0de120ff37513f7e0d5abe0104ba34814183f /Tools
parentaeeda5b276e26eafa8c1e8fa8af08c0af7d7f34c (diff)
downloadcpython-1f05cb007a12f018183630df6dc1e82fb472b8a3.zip
cpython-1f05cb007a12f018183630df6dc1e82fb472b8a3.tar.gz
cpython-1f05cb007a12f018183630df6dc1e82fb472b8a3.tar.bz2
OK, here's a different way to implement the same thing -- this version
also supports filenames with multiple spaces in their name :-)
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/ftpmirror.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Tools/scripts/ftpmirror.py b/Tools/scripts/ftpmirror.py
index d546f33..c73251a 100755
--- a/Tools/scripts/ftpmirror.py
+++ b/Tools/scripts/ftpmirror.py
@@ -132,17 +132,17 @@ def mirrorsubdir(f, localdir):
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: