inotify_watch_cr

Version, currently master branch1 version
  • master branchlatestDec 26, 2022

github.com/ntumbuka/inotify_cr

File system events watcher in Crystal

0 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  inotify_watch_cr:
    github: ntumbuka/inotify_cr
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
1.5.1
License
MIT
Author
Walter Kaunda
Target
  • inotify_watch from src/watch.cr

Dependencies

This version declares no dependencies.

README

inotify_cr

Tracks file creations and deletions in a directory. This project was meant to help me learn a bit about creating C library bindings. Don't take it too seriously. If you need a properly built tool with similar functionality then please look at inotify-tools.

Building

Building this requires Crystal 1.6.1 or better and Linux with GNU libc

crystal build src/watch.cr

Usage

./watch path-to-directory

Once you start the application, it will log lines as below for every file create and delete. This will only work on file systems that inotify supports.

DELETED: file1
DELETED: file2
DELETED: file3
DELETED: file5
CREATED: file1

Contributing

  1. Fork it (https://github.com/kwalter94/inotify_cr/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors