.. highlightlang:: us .. index:: FileWatchAdd .. _filewatchadd: FileWatchAdd ============ .. us.tag FileWatchAdd ENGLISH FILE_MISC New321 Changed5501 :ref:`FileWatchAdd` adds a file to the list of watched files. If the operating system detects a change to the file the callback function is called. .. function:: bool = FileWatchAdd(ssFileName, ssCallback) bool = FileWatchAdd(ssFileName, ssCallback, rsData) .. us.return **Return Value** *bool* is TRUE, if the file could be added to the list of watched files. .. us.params **Parameters** .. uparam:: ssFileName Complete file name. .. uparam:: ssCallback Name of a callback function which will be called if the file has been modified. The callback function must be specified by the user. The callback function has one parameter, the complete filename of the watched file. .. uparam:: rsData A scalar number. .. us.example **Example** :: FileWatchAdd("c:/test.txt", "MyReloadFunction"); def MyReloadFunction(ssFile) { // Do something with the file .... } **Example** :: FileWatchAdd("c:/test.txt", "MyReloadFunction", 123); def MyReloadFunction(ssFile, rsData) { // Do something with the file .... } .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - R2013.1 - New parameter *rsData*. * - 3.2.1 - New. .. seealso:: :ref:`overview-binary-and-text-files`, :ref:`FileWatchRemove` :sub:`id-679831`