Lines 32-43
Link Here
|
32 |
|
32 |
|
33 |
self.cleanBusyFiles() |
33 |
self.cleanBusyFiles() |
34 |
|
34 |
|
35 |
def getDestFilename(self, srcfile): |
35 |
def getDestFilename(self, destdir, srcfile): |
36 |
"""calculate a destination filename based on the srcfile filename.""" |
36 |
"""calculate a destination filename based on the srcfile filename.""" |
37 |
my_fn = ".$busy-" + srcfile + "." |
37 |
my_fn = ".$busy-" + srcfile + "." |
38 |
my_num = 0 |
38 |
my_num = 0 |
39 |
|
39 |
|
40 |
while os.access(my_fn + str(my_num), os.F_OK): |
40 |
while os.access(os.path.join(destdir, my_fn + str(my_num)), os.F_OK): |
41 |
my_num += 1 |
41 |
my_num += 1 |
42 |
|
42 |
|
43 |
return my_fn + str(my_num) |
43 |
return my_fn + str(my_num) |
Lines 57-63
Link Here
|
57 |
dst_dir = os.path.dirname(srcfile) |
57 |
dst_dir = os.path.dirname(srcfile) |
58 |
src_nam = os.path.basename(srcfile) |
58 |
src_nam = os.path.basename(srcfile) |
59 |
|
59 |
|
60 |
destfile = os.path.join(dst_dir, self.getDestFilename(src_nam)) |
60 |
destfile = os.path.join(dst_dir, self.getDestFilename(dst_dir, src_nam)) |
61 |
|
61 |
|
62 |
try: |
62 |
try: |
63 |
os.rename(srcfile, destfile) |
63 |
os.rename(srcfile, destfile) |