coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

`sync`: cleanup and implement `fsync` if files are given

Open tertsdiepraam opened this issue 1 year ago • 3 comments

Changes:

  • The files are PathBuf now, allowing invalid UTF-8
  • We've got fsync now if files are given but neither --data or --file-system is passed.
  • We no longer check the paths up front, but while opening the paths.
  • Our functions are no longer marked unsafe, because they aren't :)
  • --data and --file-system are hidden when they are not supported
  • --data and --file-system trigger an error when they are used, but not supported
  • Some functions were (I think) available on more platforms that what we were using, so I tried to remove from cfg gates.

I can't be bothered with also fixing Windows right now :)

I tried to use nix, but it was sadly missing some Android stuff, which I've made a PR for: https://github.com/nix-rust/nix/pull/2296.

tertsdiepraam avatar Jan 17 '24 12:01 tertsdiepraam

Meh, I'll fix Mac soon

tertsdiepraam avatar Jan 17 '24 12:01 tertsdiepraam

GNU testsuite comparison:

GNU test failed: tests/misc/sync. tests/misc/sync is passing on 'main'. Maybe you have to rebase?

github-actions[bot] avatar Jan 17 '24 12:01 github-actions[bot]