1
1
Fork
You've already forked nfp
0
nfp is a tool that watches directories for new files and calls user-defined commands on them. Like automatically calling an upload script on a file exported from a graphics editor to a specified directory.
  • Rust 100%
Ivan Sagalaev aebb7bae74 Don't require valid config in ensure_default
When editing the config via `nfp -e` it's entirely possible it's going
to be temporarily broken. In this case, trying to parse it results in
abnormal exit. Instead, we should just return without an error if the
file exists.
2026年06月29日 22:59:54 -07:00
src Don't require valid config in ensure_default 2026年06月29日 22:59:54 -07:00
.ignore Add Cargo.lock to ignores 2026年05月04日 11:43:49 -07:00
Cargo.toml Update version and dependencies 2026年05月04日 11:45:31 -07:00
LICENSE Update author and license metadata 2026年05月04日 11:43:49 -07:00
README.md Correct phrasing in README 2026年05月04日 11:45:31 -07:00

New File Processor

nfp is a tool that watches directories for new files and calls user-defined commands on them. Like automatically calling an upload script on a file exported from a graphics editor to a specified directory.

Config

nfp is configured by a TOML file like this:

[[processors]]
path = "/home/user/.local/share/nfp/export1"
depth = 1
command = "python"
args = ["/path/to/upload.py", "%f"] # %f is replaced with a filename
keep_file = true
debounce = 500

The easiest way to create or edit the config is to run nfp -e. It will provide a commented example if the config is not present.

The config file is looked up in nfp/config.toml under the common config directory on you platform (using directories crate to resolve that.)

A running nfp daemon will automatically pick up changes to the config. If the config is broken and unparsable, the daemon will continue to use its current configuration and watching for further config changes.

Runnning

In the simplest case it's just:

nfp

You probably want to run that on start-up and redirect stdout/stderr somewhere sensible.

nfp >> ~/.local/state/nfp/log 2>&1

You could also just run it via nohup and simply close the terminal window after that.