combox

split and encrypted files between online file storage providers
git clone git://git.ricketyspace.net/combox.git
Log | Files | Refs

commit 9d14db03da5d10d5ab0d7cc76b20e7b1ed5523bf
parent f1a828b2ae28f6ced224d8055bd52c053bd70b38
Author: Siddharth Ravikumar <sravik@bgsu.edu>
Date:   Sat, 12 Sep 2015 22:04:15 -0400

fix for bug #6

Now, we check if the directory contains files, if it does, then we
delay the deletion of the directory.

Diffstat:
combox/events.py | 13+++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/combox/events.py b/combox/events.py @@ -521,8 +521,17 @@ class NodeDirMonitor(LoggingEventHandler): if num == self.num_nodes: # Delete corresponding directory under the combox # directory. - rm_path(file_cb_path) - self.silo.node_rem('file_deleted', file_cb_path) + if os.listdir(file_cb_path): + # There are files under this directory that + # are not deleted yet, so we got to delay + # deletion :| + print "Marking", file_cb_path, "for later deletion." + delayed_thread = Timer(15, self.delete_later, + [file_cb_path]) + delayed_thread.start() + else: + rm_path(file_cb_path) + self.silo.node_rem('file_deleted', file_cb_path) elif not event.is_directory and path.exists(file_cb_path): print event.src_path, "must have been deleted on another computer." with self.lock: