Существует порт Windows, inotifywait
как указано в комментариях, под названиемinotify-win
Скачать:
https://github.com/thekid/inotify-win/archive/master.zip
Обобщение:
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\csc.exe /t:exe /out:inotifywait.exe src\*.cs
Использование:
$ inotifywait.exe Usage: inotifywait [options] path [...] Options: -r/--recursive: Recursively watch all files and subdirectories inside path -m/--monitor: Keep running until killed (e.g. via Ctrl+C) -q/--quiet: Do not output information about actions -e/--event list: Events (create, modify, delete, move) to watch, comma-separated. Default: all --format format: Format string for output. --exclude: Do not process any events whose filename matches the specified regex --excludei: Ditto, case-insensitive Formats: %e : Event name %f : File name %w : Path name %T : Current date and time
Редактировать:
Если вы хотите избежать злонамеренных действий, решение может быть icacls
в файловой системе NTFS
Чтобы защитить файл от удаления:
icacls file.ext /deny Everyone:(DE) rem To reset icacls file.ext /reset
Чтобы защитить папку с ее содержимым, используйте:
icacls folder /deny Everyone:(OI)(CI)(DE,DC) rem To reset icacls folder /reset
*S-1-1-0
вместо того, чтобы не зависеть от Everyone
языка, а также %USERNAME%
для текущего пользователя.