A newer version of Max is available. Click here to access the latest version of this document.

filewatch

Notify Max of a file change

Description

filewatch can be set to watch a particular file and will report a bang whenever that file is altered.

Arguments

Name Type Opt Description
filename symbol opt An optional symbol argument specifies the file name to watch.

Messages

bang The bang message functions the same as sending a non-zero number, causing the object to commence watching the file for changes.
int filewatch-flag (0 or non-zero) [int]
Turns on the filewatch object. Sending a non-zero number causes the filewatch object to commence watching the file for changes. Sending a 0 causes the object to ignore changes to the file.
anything filepath/filename [list]
A filepath or filename within the Max search path will set which file is to be watched by filepath.
stop The stop message functions the same as sending a 0, causing the object to ignore any file changes.

Information for box attributes common to all objects

Output

bang: When the filewatch object is active, any change to the specified file will cause filewatch to output a bang.

Examples

Max will be notified of any changes in a file

See Also

Name Description
absolutepath Convert a file name to an absolute path
opendialog Open a dialog to ask for a file or folder
relativepath Convert an absolute to a relative path
savedialog Open a dialog to ask for a filename for saving