Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1f05cb0

Browse files
committed
OK, here's a different way to implement the same thing -- this version
also supports filenames with multiple spaces in their name :-)
1 parent aeeda5b commit 1f05cb0

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Tools/scripts/ftpmirror.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,17 +132,17 @@ def mirrorsubdir(f, localdir):
132132
infostuff = ''
133133
else:
134134
# Parse, assuming a UNIX listing
135-
words = string.split(line)
135+
words = string.split(line, None, 8)
136136
if len(words) < 6:
137137
if verbose > 1: print 'Skipping short line'
138138
continue
139-
if words[-2] == '->':
139+
filename = words[-1]
140+
if string.find(filename, " -> ") >= 0:
140141
if verbose > 1:
141-
print 'Skipping symbolic link %s -> %s' % \
142-
(words[-3], words[-1])
142+
print 'Skipping symbolic link %s' % \
143+
filename
143144
continue
144-
filename = string.join(words[8:])
145-
infostuff = words[5:]
145+
infostuff = words[-5:-1]
146146
mode = words[0]
147147
skip = 0
148148
for pat in skippats:

0 commit comments

Comments
 (0)