An arbitrary name assigned to the watch. You use this name in the FILE.WATCH_DESTROY().
The folder that you want to monitor.
Flags - the flags that indicate which events you want to trap. The flags are:
File renamed, added or deleted.
Directory renamed, added or deleted.
Length of a file changed.
Date/time stamp on a file changed.
Security setting changed.
A string containing the Xbasic code to be executed. E.g. " script_play(\"script_to_run\") ".
Executes code on change of some aspect of a path changes (flags F= files renamed/add/delete D= sub-directory renamed/added/deleted A=Attributes changed L=Length of file(s) changed T=Time Changed S=File security changed R=recurse).
The FILE.WATCH_CREATE() method allows you to monitor the activity in a particular folder on your computer, and automatically execute Xbasic code when:
- a file is added or deleted in the folder
- the size of a file in the folder is changed
- the attributes of a file in the folder are changed
- a sub-folder is added
- the date/time stamp on a file changed
- security settings on a file in the folder are changed
You can specify which of the events to react to.
FILE.watch_create("temp_dir", "c:\temp", "F", "my_alert_function()") ? FILE.watch_enumerate() = temp_dir c:\temp F FILE.watch_destroy("temp_dir")
To find the name of the most recently created file use FILEFIND.GET().