def Link(self, pck, name): dstname = os.path.join(pck.directory, name) if (pck.id, name) in self.links: self.Unlink(pck, name) with self.lock: self.links[(pck.id, name)] = dstname osspec.create_symlink(self.path, dstname, reallocate=False) self.accessTime = time.time()
def Relink(self, estimated_path): with self.lock: self.path = estimated_path for dstname in self.links.itervalues(): dstdir = os.path.split(dstname)[0] if not os.path.isdir(dstdir): logging.warning("binfile\tcan't relink nonexisted packet data %s", dstdir) elif os.path._resolve_link(dstname) != self.path: osspec.create_symlink(self.path, dstname, reallocate=True)
def Relink(self, estimated_path): with self.lock: self.path = estimated_path for dstname in self.links.itervalues(): dstdir = os.path.split(dstname)[0] if not os.path.isdir(dstdir): logging.warning( "binfile\tcan't relink nonexisted packet data %s", dstdir) elif os.path._resolve_link(dstname) != self.path: osspec.create_symlink(self.path, dstname, reallocate=True)