发布日期: 09/18/2023

Object Attributes

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."
);
需要更多信息?有问题?从 JMP 用户社区得到解答 (community.jmp.com).