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

Bug in entr call to watch_folder #470

Closed
samanklesaria opened this issue Apr 30, 2020 · 1 comment
Closed

Bug in entr call to watch_folder #470

samanklesaria opened this issue Apr 30, 2020 · 1 comment
Labels

Comments

@samanklesaria
Copy link

samanklesaria commented Apr 30, 2020

Line 822 of Revise.jl calls FileWatching.watch_folder. It then calls ret.changed on the result. But FileWatching.watch_folder returns a pair:

julia> FileWatching.watch_folder("src")
"extra.jl" => FileWatching.FileEvent(false, true, false)

As the documentation says:

The returned value is an pair where the first field is the name of the changed file (if available) and the second field is an object with boolean fields changed, renamed, and timedout, giving the event.

Should be an easy fix. I'll make a pull request.

samanklesaria added a commit to samanklesaria/Revise.jl that referenced this issue Apr 30, 2020
samanklesaria added a commit to samanklesaria/Revise.jl that referenced this issue May 4, 2020
@ffevotte
Copy link
Collaborator

ffevotte commented May 24, 2020

I think this is now fixed by #488

EDIT: no, it's not. Watching directories with entr does not error anymore, but does not work either (yet)

EDIT(again): further tests seem to indicate that watching directories works (at least on Linux), provided that the trailing forward slash is not ommited. I.e.

entr("/path/to/dir/", []) do
   println("something changed")
end

works, but not

entr("/path/to/dir", []) do
   println("something changed")
end

timholy added a commit that referenced this issue May 25, 2020
@timholy timholy added the bug label May 25, 2020
timholy added a commit that referenced this issue May 25, 2020
ffevotte added a commit to ffevotte/Revise.jl that referenced this issue Jun 2, 2020
This fixes uses of `entr` to watch directories, both when `Revise` watches
directories (`watching_files[] = false`) and when it watches
directories (`watching_files[] = true`).

Tests mirror those defined for `entr` on regular files, and check in particular that:
- file creations, modifications and deletions in the directory are correctly
  detected;
- clustered notifications trigger the callback only once;
- empty directories are correctly handled (i.e. they remain in the watch list
  even when all files in them are deleted).

Closes: timholy#470
ffevotte added a commit to ffevotte/Revise.jl that referenced this issue Jun 6, 2020
This fixes uses of `entr` to watch directories, both when `Revise` watches
directories (`watching_files[] = false`) and when it watches
directories (`watching_files[] = true`).

Tests mirror those defined for `entr` on regular files, and check in particular that:
- file creations, modifications and deletions in the directory are correctly
  detected;
- clustered notifications trigger the callback only once;
- empty directories are correctly handled (i.e. they remain in the watch list
  even when all files in them are deleted).

Closes: timholy#470
ffevotte added a commit to ffevotte/Revise.jl that referenced this issue Jun 6, 2020
This fixes uses of `entr` to watch directories, both when `Revise` watches
directories (`watching_files[] = false`) and when it watches
files (`watching_files[] = true`).

Tests mirror those defined for `entr` on regular files, and check in particular that:
- file creations, modifications and deletions in the directory are correctly
  detected;
- clustered notifications trigger the callback only once;
- empty directories are correctly handled (i.e. they remain in the watch list
  even when all files in them are deleted).

Closes: timholy#470
ffevotte added a commit to ffevotte/Revise.jl that referenced this issue Jun 6, 2020
This fixes uses of `entr` to watch directories, both when `Revise` watches
directories (`watching_files[] = false`) and when it watches
files (`watching_files[] = true`).

Tests mirror those defined for `entr` on regular files, and check in particular that:
- file creations, modifications and deletions in the directory are correctly
  detected;
- clustered notifications trigger the callback only once;
- empty directories are correctly handled (i.e. they remain in the watch list
  even when all files in them are deleted).

Closes: timholy#470
@timholy timholy closed this as completed in 8cd9013 Jun 7, 2020
timholy added a commit that referenced this issue Jun 7, 2020
Allow `entr` to watch directories (fixes #470)
@ffevotte ffevotte mentioned this issue Jun 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants