fsevent-rust icon indicating copy to clipboard operation
fsevent-rust copied to clipboard

hardlink creation is not picked up

Open ctsrc opened this issue 5 years ago • 1 comments

Hardlink creation is not noticed. Don't know if this is a bug in fsevent/fsevent-sys, or if it's just how the Apple File System Events API works, or if there is some other problem.

Regular file creation, and even deletion of hardlinks are noticed and reported though.

Steps to reproduce:

  1. On an APFS file system on macOS Catalina, create a directory that we will watch. As an example, let's do:

    mkdir -p ~/tmp/hello/world/
    
  2. Create a file somewhere outside of the watched directory structure.

    touch ~/tmp/hello/somefile
    
  3. Use the fsevent crate to watch the directory that we created in step 1 (~/tmp/hello/world/).

  4. Create a regular file in the watched directory.

    touch ~/tmp/hello/world/one
    
  5. Notice that the file creation is picked up as expected.

  6. Create a hardlink inside of the watched directory.

    cd ~/tmp/hello/world/ && ln ../somefile .
    
  7. The hardlink creation is not noticed by fsevent.

ctsrc avatar Mar 20 '20 04:03 ctsrc

The fact the the deletion of hardlink is noticed but not their creation looks like a bug for me... 🔍

octplane avatar Mar 26 '20 09:03 octplane