Skip to content

Instantly share code, notes, and snippets.

@zmwangx
Last active April 13, 2023 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zmwangx/c76ce710fbca1bea7a53a55d69211861 to your computer and use it in GitHub Desktop.
Save zmwangx/c76ce710fbca1bea7a53a55d69211861 to your computer and use it in GitHub Desktop.

When a file is being copied in on macOS, the com.apple.FinderInfo xattr is set to the 32-byte value

627a7920 00000000 00000000 00000000 00000000 00000000 00000000 00000000

which would show up as bzy with xattr -p com.apple.FinderInfo /path/to/file. (This may only be true when there are no additional attributes likes flags.) This can be used to test whether a file copy has completed.

Conversely, one can also use

xattr -wx com.apple.FinderInfo '627a7920 00000000 00000000 00000000 00000000 00000000 00000000 00000000' /path/to/file

to emulate the in-progress visual when writing a file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment