dagostini / DAFileMonitor

A simple wrapper around dispatch sources.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DAFileMonitor

Version License Platform

Description

With this library you can monitor a file for changes and you will receive a callback when the file changes. It's as simple as that :) The library itself is a wrapper around dispatch sources.

You can read more about the library on my blog: http://agostini.tech/2017/08/06/monitoring-files-using-dispatch-sources/

Usage

var fileMonitor = DAFileMonitor(withFilePath: filePath)
fileMonitor?.onFileEvent = {
    // This closure is called when your file changes.
}

Installation

DAFileMonitor is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "DAFileMonitor"

Author

Dejan Agostini, dejan.agostini@gmail.com

License

DAFileMonitor is available under the MIT license. See the LICENSE file for more info.

About

A simple wrapper around dispatch sources.

License:MIT License


Languages

Language:Shell 63.6%Language:Swift 21.0%Language:Ruby 8.7%Language:Objective-C 6.8%