You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Promising wrappers here! Unfortunately I can't quite get it to run, but maybe I'm doing it wrong.
Running Mac OS X (Darwin v. 10.13.6)
Installed fswatch with brew, ie) brew install fswatch.
Installed this library using nimble, ie) nimble install fswatch.
When I try running the example code, I get an error on line 5, the monitor.setCallback(callback). Its template/generic instantiation of `setCallback` from here. And another, monitor.start() gives the error Error: undeclared identifier: 'data'. I'm guessing the first error is related to the first error though.
Judging from this project's README, this has only been tested on Linux. So I changed the library's libfswatch_fn variable in libsfwatch.nim file to const libfswatch_fn* = "/usr/local/Cellar/fswatch/1.14.0/lib/libfswatch.11.dylib", which is the path to my lib on os x. But I still get the same error after changing this.
If I'm just doing something plain wrong, please let me know and close the issue. Thanks!
The text was updated successfully, but these errors were encountered:
@jasonk000 ah thanks! I created a var globally in the example like
import times, fswatch
var data = ""
var monitor = newMonitor(latency=0.01)
monitor.add("/Users/mikebelanger/Dev/Personal/nim_filewatcher/some_file.txt")
proc callback(eg: EventGroup) =
for e in eg:
echo e.path, " ", $e.kind, " ", e.time.utc()
monitor.setCallback(callback)
# blocks here
monitor.start()
Should this go into the main example? Or is it so simple that most dev's would get this anyway?
Also, For any other mac (brew) users: changing the libfswatch.nim's libfswatch_fn to "/usr/local/Cellar/fswatch/1.14.0/lib/libfswatch.11.dylib" was necessary as well.
Hello!
Promising wrappers here! Unfortunately I can't quite get it to run, but maybe I'm doing it wrong.
brew install fswatch
.nimble install fswatch
.When I try running the example code, I get an error on line 5, the
monitor.setCallback(callback)
. Itstemplate/generic instantiation of `setCallback` from here
. And another,monitor.start()
gives the errorError: undeclared identifier: 'data'
. I'm guessing the first error is related to the first error though.Judging from this project's README, this has only been tested on Linux. So I changed the library's
libfswatch_fn
variable inlibsfwatch.nim
file toconst libfswatch_fn* = "/usr/local/Cellar/fswatch/1.14.0/lib/libfswatch.11.dylib"
, which is the path to my lib on os x. But I still get the same error after changing this.If I'm just doing something plain wrong, please let me know and close the issue. Thanks!
The text was updated successfully, but these errors were encountered: