Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.



Introduced in

Version:2.12

Description

Description:

Specifies which files should trigger a FileChanged event.


If wildcards are used, then only

those

the files that

existed

exist at the execution of

this

the command

will be

are considered. Other files

which were

that are added later (even though they might match the filter),

will be

are ignored.

Multiple watches can be created, with the later ones being added to the list (rather than replacing the existing one).

Syntax

Syntax:fileWatch filter
Parameters:
  • filter: String - File name, or full path to file to
be watched
  • watch. Typical windows wildcards (* or ?) can be used on the file name (but not the path).

  • If no path is specified, then the installation folder is used.
Return Value:Nothing
-

Examples

Examples:
// create global fileChanged event handler
addGlobalEventHandler ["FileChanged", "systemChat format['fileChanged: %1',_this]"]; 

// specify which file to watch
fileWatch "d:\bi\tst.txt"; 
// watch any .log files in the installation folder
fileWatch "*.log"; 

Additional Information

See also: fileUnwatch, FileChanged
Multiplayer: 
Problems:File that are watched cannot be deleted (or moved, or renamed). In V3.x, this lock is released once the file is fileUnwatch, but in V2.x even that
doesn't
does not help, and VBS may have to be restarted to release a locked file.

Notes