Bug #15026 File/directory watcher, File System Trigger?
Submitted: 17 Nov 2005 16:55 Modified: 14 Jun 2013 18:27
Reporter: Keith Blackwell Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Locking Severity:S4 (Feature request)
Version:5.0 OS:Windows (Win32)
Assigned to: Assigned Account CPU Architecture:Any

[17 Nov 2005 16:55] Keith Blackwell
Description:
Currently, external means of determining if a file exists in a specific directory must be used to perform such actions on that file.  For example, cron, or Windows' Task Scheduer, must be run periodically to determine if an import file exists in a directory, and if so, it must fire off some command-line to perform actions on these files, such as mysqlimport.exe 

How to repeat:
make mysql watch for a file and do something with it if/when it appears and isn't locked.

Suggested fix:
It would be nice to have a file/directory watcher, gui-configurable.  Maybe this would be considered a File System Trigger.
For example, watch a certain directory for files with specific names, or extentions. Allow file checking to make sure file isn't in use/open.  Perform actions on these files such as import/load, write to from table X, etc.
My specific need is to watch for a directory to which delimited text files are dumped on a fairly random basis.  When they're found and are not "in-use", import into a table.  Right now I've got a custom Windows Service that I built which watches for file activity and executes the mysqlimport.exe with all the parameters necessary to import the file into a specific table.