示例#1
0
 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()
示例#2
0
 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()
示例#3
0
 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)
示例#4
0
 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)