Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unknown error -1, when watching directory for delete event #197

Open
PieterHagedoorn opened this issue Oct 31, 2023 · 1 comment
Open

unknown error -1, when watching directory for delete event #197

PieterHagedoorn opened this issue Oct 31, 2023 · 1 comment

Comments

@PieterHagedoorn
Copy link

description

I'm watching a directory recursively on delete event. When a file or directory is deleted, It is also deleted in another directory. The file case works fine. The directory case works, as in the directory does get deleted, but I get an error in the terminal:

Failed to remove watch on ./js-source/test/: Unknown error -1
Error removing watch on ./js-source/test/: Unknown error -1

The program does not exit and nothing breaks for as I can see.

The bash script

    inotifywait -m -r -e delete -e moved_from ./js-source |
        while read path action file; do
            if [ -d "./js/${path#"./js-source/"}$file" ]; then
                echo "remove $path$file"
                rm -r "./js/${path#"./js-source/"}$file"
            fi
            if [ -f "./js/${path#"./js-source/"}$file" ]; then
                echo "remove $path$file"
                rm "./js/${path#"./js-source/"}$file"
            fi
        done

steps to reproduce:

  • make a folder called js-source and a folder called js
  • in both folders make a folder with the same name (let's say test)
  • run the script above
  • delete/remove the folder in js-source

expected behaviour:

The dir in the js folder is also removed without errors

actual behaviour:

The dir is removed, but some errors are put in the terminal

my system:

Debian 11 running through wsl2 on windows 11

@PieterHagedoorn
Copy link
Author

might have something to do with #35 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant