https://github.com/simongray/beholder-deletion-issue
https://github.com/simongray/beholder-deletion-issue
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/simongray/beholder-deletion-issue
- Owner: simongray
- Created: 2022-11-13T14:23:25.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-13T14:35:49.000Z (over 3 years ago)
- Last Synced: 2025-09-12T12:08:06.135Z (9 months ago)
- Language: Clojure
- Size: 23 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Beholder/directory-watcher deletion issue
This Clojure code demonstrates an issue with deleting files in [beholder](https://github.com/nextjournal/beholder) and the library it is wrapping, [directory-watcher](https://github.com/gmethvin/directory-watcher).
Run the [beholder-issue.jar](/beholder-issue.jar) file using
```shell
java -jar beholder-issue.jar
```
> I ran this with Java 19 on an Apple Silicon Macbook Air using macOS 13. The program depends on directory-watcher 0.17.0.
This will create `testdir/` along with two files, `before.txt` and `after.txt`, created before and after the watcher process is instantiated, respectively. Both files are then deleted.
* The state of the files created is printed after each significant change.
* The signals of the watcher are also printed as they arrive.
* I have inserted three 1 second pauses to make sure that the async nature of all this file-watching doesn't mess up the results.
On my machine the program outputs:
```
files:
testdir
testdir/before.txt
(starting watcher process..)
files:
testdir
testdir/before.txt
testdir/after.txt
watcher: create /Users/simongray/testdir/after.txt
files:
testdir
watcher: delete /Users/simongray/testdir/after.txt
```
... i.e. it only registers the deletion of the `after.txt` file, not the other file.