Ejemplo n.º 1
0
 def _fsync(self, f):
     if self.configuration.get("storage", "_filesystem_fsync"):
         try:
             pathutils.fsync(f.fileno())
         except OSError as e:
             raise RuntimeError("Fsync'ing file %r failed: %s" %
                                (f.name, e)) from e
Ejemplo n.º 2
0
    def _sync_directory(self, path):
        """Sync directory to disk.

        This only works on POSIX and does nothing on other systems.

        """
        if not self.configuration.get("storage", "_filesystem_fsync"):
            return
        if os.name == "posix":
            try:
                fd = os.open(path, 0)
                try:
                    pathutils.fsync(fd)
                finally:
                    os.close(fd)
            except OSError as e:
                raise RuntimeError("Fsync'ing directory %r failed: %s" %
                                   (path, e)) from e
Ejemplo n.º 3
0
 def _fsync(self, fd):
     if self.configuration.get("storage", "_filesystem_fsync"):
         pathutils.fsync(fd)
Ejemplo n.º 4
0
 def _fsync(self, fd):
     if self.configuration.get("internal", "filesystem_fsync"):
         pathutils.fsync(fd)
Ejemplo n.º 5
0
 def _fsync(cls, fd):
     if cls.configuration.getboolean("internal", "filesystem_fsync"):
         pathutils.fsync(fd)
Ejemplo n.º 6
0
 def _fsync(cls, fd):
     if cls.configuration.getboolean("internal", "filesystem_fsync"):
         pathutils.fsync(fd)