Ocha can be listen to the file system change notifications and raises events when a directory, or file in a directory, changes.
Ocha means Tea🍵 in Japan.
Usage
To use Ocha, first create a Watcher instance with file paths you want to watch.
let watcher = Watcher(paths: [pathString])
And you can call for Watcher.start(_:) method when it start to watch file events.
When file removed, you get callback with removed file path infomations.
watcher.start { (events) in ... }
Example
The following example execute git add << REMOVED_FILE_PATH >> and git commit -m << REMOVED_FILE_PATH >> to watch the file path, when it removed.
Ocha
Ocha
can be listen to the file system change notifications and raises events when a directory, or file in a directory, changes.Ocha means Tea🍵 in Japan.
Usage
To use Ocha, first create a
Watcher
instance with file paths you want to watch.And you can call for
Watcher.start(_:)
method when it start to watch file events. When file removed, you get callback with removed file path infomations.Example
The following example execute
git add << REMOVED_FILE_PATH >>
andgit commit -m << REMOVED_FILE_PATH >>
to watch the file path, when it removed.If you execute this swift code, you can confirm removed file git log.
$ git log -1
Try it easily
You can easily try Ocha by editing the
Playground
target../Sources/Playground/main.swift
.swift run Playground
on Terminal.LICENSE
Ocha is released under the MIT license. See LICENSE for details.
Header logo is released CC BY-NC 4.0 license. Original design by noainoue.