WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> Plugins >> New PLUGIN IDEA maybe already have it.
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1130724343

Message started by pir8radio on Oct 31st, 2005 at 3:05am

Title: New PLUGIN IDEA maybe already have it.
Post by pir8radio on Oct 31st, 2005 at 3:05am
All i want to do is create either HTML or .txt  file that shows only file names of changed files...  I run a file server site and would love for users to be able to see what has been added to the server.  All automatic would be cool..      so the list of files gets put in plain text on to an html template? and gets dropped into annother directory..  easy money right?

thanks guys

Title: Re: New PLUGIN IDEA maybe already have it.
Post by Gert on Oct 31st, 2005 at 5:50am
I may have a solution for this, I need to do some more testing.
I will post it later today.

Gert

Title: Re: New PLUGIN IDEA maybe already have it.
Post by Gert on Oct 31st, 2005 at 4:52pm
Ok...

Please download this archive
It contains the following files:
header.txt
 enter the html you want to show before the "latest files" listing
footer.txt
 enter the html you want to show after the listing
sqlite3.exe
 this is a command line sql processor for the SQLite database that is used by watchDirectory to store history info.
latestfiles.bat
 the .bat file you use to monitor your directory.
 You will need to change this script to set the location of the headert.txt and footer.txt (where you unzipped the archive)

Use the automatically start a .bat file plugin to start the latestfiles.bat
Configure it to only start for New Files and give it a try.

Let me know if this works ok.

Gert

Title: Re: New PLUGIN IDEA maybe already have it.
Post by TonyF on Sep 18th, 2014 at 4:05pm
Hi Gert,

This solution is really useful and I have tried it out with great success. I added the id, code and filenameori fields to your SQL query as I find this additional information useful. One thing I noticed with your original batch file was that the HTML report reported information of the last but one event (i.e. not the last change just made). I finally realized that the SQL in the batch file was reading the history file before the latest event information could be written to it. I therefore added a 'Sleep 5' statement to the batch file to pause the script for 5 seconds before the SQL query was run. This fixed the issue and now the HTML report reports the latest event. Can you think of a more elegant way of making the batch script wait till the event(s) has been written to the history file? Thanks for all you hard work in extending the capabilities of a very powerful utility. Best regards, Tony.

Title: Re: New PLUGIN IDEA maybe already have it.
Post by Gert on Sep 19th, 2014 at 5:16pm
Hello Tony,

I guess at the moment you let your task trigger for NEW FILES (the FILENEW option). Keep that option selected, but also select the QUIET option and "only one QUIET event". Set the QUIET interval to something like 10 seconds.

This will trigger the script for every new file and also trigger the script 10 seconds after the last new file is detected.

Now add the following code at the top of the bat script
[code]REM ignore all events except QUIET
IF "%WD_REASON%" NEQ "QUIET" GOTO :EOF
[/code]

The FILENEW event will be ignored by the script, but should still be selected in the task's settings.

WatchDirectory Forum » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2017. All Rights Reserved.