Skip to main content

File Monitors

Octory can monitor a file at a specified path, which will generate a variable you can use in a condition or see in the logs. The application will generate a variable based on the file name: IS_[FILENAME]_[EXTENSION]_FILE_PRESENT with a true or false value.

info

The check of the file presence happens every 5 seconds.

Keys

NameTypePossible valuesRequired
TypeStringFileRequired
PathString-Required
IsMandatoryBoolean-

Detail

Type Required

Type: String
Possible values: File
Explanation: Monitor type has to be File.

Path Required

Type: String
Explanation: The path to the file whose presence you want to monitor.

IsMandatory

Type: String
Default: false
Explanation: If true, the application will prevent the user to quit if the file is not present.

Example

Monitor the presence of the file termination.sh in the folder /Library/Application Support/Octory/Scripts/. The generated variable will be IS_TERMINATION_SH_FILE_PRESENT.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- ... -->
<key>Monitoring</key>
<dict>
<key>Monitors</key>
<array>
<dict>
<key>Type</key>
<string>File</string>
<key>Path</key>
<string>/Library/Application Support/Octory/Scripts/termination.sh</string>
</dict>
</array>
</dict>
<!-- ... -->
</dict>
</plist>

Monitor the presence of the file myFile.txt in the user home folder. The generated variable will be IS_MYFILE_TXT_FILE_PRESENT. Note the usage of a placeholder to get the current logged in user name.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- ... -->
<key>Monitoring</key>
<dict>
<key>Monitors</key>
<array>
<dict>
<key>Type</key>
<string>File</string>
<key>Path</key>
<string>/Users/${USER_NAME}/myFile.txt</string>
</dict>
</array>
</dict>
<!-- ... -->
</dict>
</plist>