JMP provides the following JSL functions to determine whether a file or directory is writable before attempting to write to them. Use these functions in combination with Is Directory(path) and Is File(path) to verify a script destination and attribute. See “Is Directory(path)” and “Is File(path)” in the JSL Syntax Reference for additional information.
The Is Directory Writable(path) function returns 1 if the directory specified in the path argument is writable and 0 otherwise.
The Is File Writable(path) function returns 1 if the file specified in the path argument is writable and 0 otherwise.
For example, the following code verifies the path refers to a directory and then checks to ensure the directory is writable:
If( Is Directory( "$SAMPLE_DATA/Loss Function Templates" ),
If( Is Directory Writable( "$SAMPLE_DATA/Loss Function Templates" ),
"Directory is writable.",
"Directory is read only!"
),
"Is a read only directory."
);