docs: def write(self):
          """
          Write the file, forcing the proper permissions
          """
          with root():
              self._write_log()
              with open(self.path, 'w') as f:
                  # file owner
                  os.chown(self.path, self.uid(), self.gid())
  
                  # mode
                  if self.mode:
                      oldmask = os.umask(0)
                      os.chmod(self.path, self.mode)
                      os.umask(oldmask)
  
                  f.write(self.contents())