Notice: Trying to access array offset on value of type bool in /var/www/virtual/ka7es/bugs.hedmen.org/scripts/details.php on line 649 FS#50 : Make removing backup and moving file into place an atomic action

Xi

  • Status New
  • Percent Complete
    0%
  • Task Type Task
  • Category Core
  • Assigned To No-one
  • Operating System All
  • Severity Medium
  • Priority Very Low
  • Reported Version master
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Xi
Opened by Roland Lutz - 2013-10-07

FS#50 - Make removing backup and moving file into place an atomic action

This could be helpful: 3.a) open and read file ~/.xi/foo/bar/baz 3.b) fd = open("~/.xi/foo/bar/baz.new", O_WRONLY|O_TRUNC|O_CREAT) 3.c) write(fd, buf-of-new-contents-of-file, size-of-new-contents-of-file) 3.d) fsync(fd) --- and check the error return from the fsync 3.e) close(fd) 3.f) rename("~/.xi/foo/bar/baz", "~/.xi/foo/bar/baz~") --- this is optional 3.g) rename("~/.xi/foo/bar/baz.new", "~/.xi/foo/bar/baz")

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing