@Theo,

Been digging through the source to track down how it does it.  Managed
to find it.  It does use a central consistent method, which does use a
tempfile.  However, it does not (as of yet) force a sync.  I'm working
on getting that added to the code now.  Here's the python routine it
uses:

self.__filename: the full path to the user's configuration file.
self.__tempfile: the same path and filename but with a dot prefix

        def write(self):
                (base_dir, filename) = os.path.split(self.__filename)
                self.__tempfile = os.path.join(base_dir, '.' + filename)
                try:
                        f = open(self.__tempfile, 'w')
                except IOError, e:
                        return str(e)
                try:
                        gajim.config.foreach(self.write_line, f)
                except IOError, e:
                        return str(e)
                f.close()
                if os.path.exists(self.__filename):
                        # win32 needs this
                        try:
                                os.remove(self.__filename)
                        except Exception:
                                pass
                try:
                        os.rename(self.__tempfile, self.__filename)
                except IOError, e:
                        return str(e)
                os.chmod(self.__filename, 0600)

-- 
Ext4 data loss
https://bugs.launchpad.net/bugs/317781
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to