borconi / when_changed

Windows utility to run a command when a file (or files) change

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

when_changed
============

Runs a Command when a file changes (Windows only)

usage:
when_changed (file path) (command) (optional-parameters)

when_changed C:\somedir\foo.txt myapp.exe
when_changed C:\somedir\*.txt myapp.exe
when_changed C:\somedir\**.txt myapp.exe   (recursive)
when_changed C:\somedir\* myapp.exe
when_changed C:\somedir\** myapp.exe (recursive)
when_changed fileincurrentdir.txt myapp.exe
when_changed C:\somedir\foo.txt myapp.exe bar wibble 123

Notes:
- Press 'F' to force the command to run.
- The utility will wait for the command to exit before running it again.
- The utility will will re-run the command if file changes whilst command is running.
- Beware of creating an infinite loop!
- (file path) must be a file path with wildcards -- not a directory.
- The search is recursive if the filename contains a double-asterisk ** (wildcards in directory names not supported.)


feedback to: blamey.ben (at) gmail.com

See http://benblamey.com/code for binaries.

About

Windows utility to run a command when a file (or files) change


Languages

Language:C# 99.7%Language:Python 0.3%