clojure - 尝试调用未绑定的 fn:#'datoteka.core/to-file
问题描述
我对clojure很陌生,我收到以下错误:
Caused by: java.lang.IllegalStateException: Attempting to call unbound fn: #'datoteka.core/to-file
at clojure.lang.Var$Unbound.throwArity(Var.java:45)
at clojure.lang.AFn.invoke(AFn.java:32)
at package.auth_monitor$start_monitor_thread.invokeStatic(auth_monitor.clj:43)
at package.auth_monitor$start_monitor_thread.invoke(auth_monitor.clj:38)
at package.auth_monitor$start_monitor.invokeStatic(auth_monitor.clj:62)
at package.auth_monitor$start_monitor.invoke(auth_monitor.clj:49)
at package.auth_monitor$fn__11768.invokeStatic(auth_monitor.clj:71)
at package.auth_monitor$fn__11768.invoke(auth_monitor.clj:70)
代码是:
42. (let [^TailerListener listener (make-listener)
43. ^File file (fs/to-file path)
44. ^Tailer tailer (Tailer. file listener 1000 true)]
45. (doto (Thread. tailer)
46. (.setDaemon false)
47. (.start)))
解决方案
我想您正在使用Datoteka库。尝试使用该file
函数File
根据路径获取对象(to-file
似乎是一个错误的名称):
(let [^TailerListener listener (make-listener)
^File file (fs/file path)
^Tailer tailer (Tailer. file listener 1000 true)]
(doto (Thread. tailer)
(.setDaemon false)
(.start)))
推荐阅读
- javascript - 如何隐藏没有产品reactjs的字符
- sql - 更新两列
- bash - 打印用 grep 找到的正则表达式字符串
- ios - 分页 UICollectionView 图像滑块 - 在末尾减慢滚动/使用弹簧阻尼曲线
- r - ggplot2 轴的主题 - x 和 y 轴之间的间隙
- java - 如何在测试类中模拟 System.currentTimeMillis?
- html - 带有 HTML 转义字符串的 JSON 解组,在对象键:值对后给出“无效字符 'T'”错误
- typescript - ajv@7.2.4 - 错误:严格模式:未知关键字:“unevaluatedProperties” -
- html - css grid vs flexbox:为什么css grid会导致重绘而flexbox不会
- selenium-webdriver - 如何防止js代码不断刷新某个页面元素