#file-change #directory #sniffer #index-file #sniff

bin+lib sniffers

A simple file change sniffer

1 unstable release

0.1.0 Jun 29, 2024

#10 in #sniffer

MIT license

13KB
210 lines

sniffers

Basic file sniffer for detecting changes in files and directories, written in Rust; complete with python bindings (of course).

Installation

pip install sniffers

Usage

from sniffers import Sniffer

sniffer = Sniffer()

# index a file or directory
sniffer.index()

# detect changes
changes = sniffer.sniff()

# print changes
for change in changes:
    print(change)

Command Line Interface

There also exists a command line interface for this package.

To build and run the CLI, run the following commands:

cargo install --path .

Then, you can run the CLI as follows:

sniffers index
sniffers sniff

lib.rs:

sniffers

sniffers is a simple library for detecting file changes. This library contains a library and a binary. The library is used to detect file changes in a directory, and the binary is used to detect file changes in a directory and run a command when a change is detected.

Library

The library contains the core logic for detecting file changes.

Usage

use sniffers::Sniffer;

let sniffer = Sniffer::default();

sniffer.index();

let altered_files = sniffer.sniff();

println!("{:?}", altered_files);

Binary

The binary wraps the library and provides a command line interface for detecting file changes.

Usage

sniffers index
sniffers sniff

Dependencies

~9–19MB
~324K SLoC