mst3000 has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to expand my programming skills and see if I can get some code to interface with the Windows USN journal.

So, my question: are there any Perl modules in existence that deal with these or has anyone ever directly accessed these through Perl?

If not, is there any other way to execute some Perl code any/every time a file being written is closed under Windows?

Hopefully one of the more experienced monks can help me in my quest. Thanks for your time.

Replies are listed 'Best First'.
Re: NTFS USN change journal in Perl
by BrowserUk (Patriarch) on May 12, 2012 at 20:44 UTC
    see if I can get some code to interface with the Windows USN journal.

    By far the simplest way would be to use backticks or a piped open to grab the output from fsutil.exe:

    C:\test>fsutil usn ? ---- USN Commands Supported ---- createjournal Create a USN journal deletejournal Delete a USN journal enumdata Enumerate USN data queryjournal Query the USN data for a volume readdata Read the USN data for a file

    You might also take a look at Win32::ChangeNotify.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?