Walker News

WFSLog – Open Source Freeware To Monitor Windows Filesystem Change

While googling GNU Swatch for Windows to monitor or track file changes on Windows 7, I stumbled upon sample source code to develop a simple C# console program that make uses of FileSystemWatcher provided by .Net Framework version 1.0 to 4.0.

As an amateur programmer without talent and knows little on C# .Net, I modified the sample code to build this “open source” freeware, wfslog (Windows Filesystem Logger), with the following features.
You’re welcomed to enhance it (and optionally inform me for kindness).

wfslog - open source freeware used to monitor file changes on Windows system.
  • Tiny console program – easier to use with Task Scheduler and Windows Scripting
  • Track changes of all files, including hidden files, in root directory of interest as well as all its sub-folders
  • Print date and time, type of change, and name of the file in question
  • Colorize the output on Command Prompt with reference to type of change.
  • Beeps whenever file changes detected – good as an audible alert when wfslog running behind active window.
  • NO robust error handling and might crash if user input is out-of-range or invalid – so use it at your own risk!
WFSLog works on Windows 7 32/64-bit with .Net Framework 4 installed. Though, I believe it works on other Windows systems with at least .Net Framework version 1.0 installed (recompile the source code with corresponding C# compiler?)

How to use wfslog to track file changes on Windows

Save wfslog.exe to one of the folders in Windows system path, e.g. C:\Windows. To check Windows system path, open Command Prompt window and run set path.

Syntax:
wfslog DIR [FILE] [BUF] [FRE] [DUR]

Where
  • DIR is the root folder to be monitored
  • FILE is the files to be tracked for changes (allows wildcard character); optional (default is to track all files)
  • BUF is buffer size (byte) used by FileSystemWatcher to store file change notifications throw by Windows; optional (default 8192); min. 4096; max. 65536
  • FRE is the beep frequency (Hz); optional (default 37 – sounds like mosquito); min. 37; max. 32767
  • DUR is the beep duration (ms); optional (default 1); min. 1

Notes:
  • If any one of the optional console program arguments / options is used, all of them must be specified.
  • BUFFER must not exceed 65536 (64KB) and recommended to be in multiple of 1024 for performance’s sake.
  • The InternalBufferOverflowException error (green color of text) triggers if Windows reports filesystem change events rapidly and the buffer size is too small to keep all these change events that are pending for FileSystemWatcher to process.

Examples:

To track all file changes in C:\ drive:
wfslog C:\

To track all log files (e.g. *.log) in C:\ drive:
wfslog C:\ *.log 8192 300 200

Now, if you’re interested on wfslog, download wfslog.zip and use the compiled program right away or compile the source code with C# command line compiler yourself.

For security’s sake, please run MD5 checksum verifier to validate integrity of downloaded files:
  • WFSLog.zip – deff6b0f4d30ccbb5611fb607e0bba57
  • WFSLog.exe – 7a9756a174d9f396ea8a4241cda0df52
  • WFSLog.cs – ed68e4f60d93d0d5dacf06781c49812e

Custom Search

2014  •  Privacy Policy