I have multiple directories and sub directories I'm monitoring for newly created files. I need to capture all the new file names in a table. file.watch() monitors them but how do I find the file that was created? I'm assuming the best method will be using filefind.List_New_Files()
Option1: Loop through each file to see if they exist in the "existing files" table.
Option2: Set the time increments down to the second instead of hour like you have(but I could see errors with this because of delays in processing time).
Option3: Populate the temp table and sort by created date and pull only the first record, removing the rest.
I'll be honest, this was posted on V8 message board. Props to Stan for contributing here was his illustration but does not solve the issue.
Code:
chk_dt = date()
chk_hr = "06:00:00 00"
chk_ampm = "am"
lst = filefind.List_New_Files("c:\\", "*.txt", chk_dt,chk_hr,chk_ampm)
? lst
= c:\Documents and Settings\All Users\Dell\UCM\SMManager.txt
c:\Documents and Settings\smathews\Cookies\[email protected][2].txt
c:\Documents and Settings\smathews\Cookies\smathews@aggregateknowledge[2].txt
c:\Documents and Settings\smathews\Cookies\[email protected][2].txt
c:\Documents and Settings\smathews\Cookies\smathews@fastclick[2].txt
c:\Documents and Settings\smathews\Cookies\[email protected][1].txt
c:\Documents and Settings\smathews\Cookies\[email protected][2].txt
c:\Documents and Settings\smathews\Cookies\[email protected][1].txt
c:\Documents and Settings\smathews\Cookies\smathews@yahoo[1].txt
c:\Program Files\A5V5\Recently_opened_databases.txt
c:\Program Files\Trend Micro\Client Server Security Agent\AU_Log\TmuDump.txt
c:\WINDOWS\system32\log.txt
c:\WINDOWS\Temp\WGAErrLog.txt
Option1: Loop through each file to see if they exist in the "existing files" table.
Option2: Set the time increments down to the second instead of hour like you have(but I could see errors with this because of delays in processing time).
Option3: Populate the temp table and sort by created date and pull only the first record, removing the rest.
I'll be honest, this was posted on V8 message board. Props to Stan for contributing here was his illustration but does not solve the issue.
Code:
chk_dt = date()
chk_hr = "06:00:00 00"
chk_ampm = "am"
lst = filefind.List_New_Files("c:\\", "*.txt", chk_dt,chk_hr,chk_ampm)
? lst
= c:\Documents and Settings\All Users\Dell\UCM\SMManager.txt
c:\Documents and Settings\smathews\Cookies\[email protected][2].txt
c:\Documents and Settings\smathews\Cookies\smathews@aggregateknowledge[2].txt
c:\Documents and Settings\smathews\Cookies\[email protected][2].txt
c:\Documents and Settings\smathews\Cookies\smathews@fastclick[2].txt
c:\Documents and Settings\smathews\Cookies\[email protected][1].txt
c:\Documents and Settings\smathews\Cookies\[email protected][2].txt
c:\Documents and Settings\smathews\Cookies\[email protected][1].txt
c:\Documents and Settings\smathews\Cookies\smathews@yahoo[1].txt
c:\Program Files\A5V5\Recently_opened_databases.txt
c:\Program Files\Trend Micro\Client Server Security Agent\AU_Log\TmuDump.txt
c:\WINDOWS\system32\log.txt
c:\WINDOWS\Temp\WGAErrLog.txt
Comment