file-monitor: simplify.
parent
2565c72b61
commit
5f3ded0b1a
|
@ -1,17 +1,14 @@
|
||||||
! Copyright (C) 2015 John Benediktsson
|
! Copyright (C) 2015 John Benediktsson
|
||||||
! See http://factorcode.org/license.txt for BSD license
|
! See http://factorcode.org/license.txt for BSD license
|
||||||
|
|
||||||
USING: accessors command-line formatting fry io io.monitors
|
USING: accessors command-line formatting io io.monitors
|
||||||
io.pathnames kernel namespaces sequences ;
|
io.pathnames kernel namespaces sequences ;
|
||||||
|
|
||||||
IN: file-monitor
|
IN: file-monitor
|
||||||
|
|
||||||
: file-monitor-loop ( monitor -- )
|
: file-monitor-loop ( monitor -- )
|
||||||
'[
|
dup next-change [ changed>> ] [ path>> ] bi
|
||||||
_ next-change
|
"%u %s\n" printf flush file-monitor-loop ;
|
||||||
[ changed>> ] [ path>> ] bi
|
|
||||||
"%u %s\n" printf flush t
|
|
||||||
] loop ;
|
|
||||||
|
|
||||||
: file-monitor-main ( -- )
|
: file-monitor-main ( -- )
|
||||||
command-line get ?first current-directory get or
|
command-line get ?first current-directory get or
|
||||||
|
|
Loading…
Reference in New Issue