Use the New File and New Directory functions to control access to files and directories, respectively. These functions include a permissions parameter, which is a 16-bit integer. LabVIEW uses the least significant 9 bits of this integer to specify file and directory access. The least significant bits are those bits that carry the least amount of data. 10 bits carry more data than 9 bits. The following illustration shows the structure of these 9 bits.
The 9 bits are divided into three sets: user, group, and others. Each set is divided into three permission categories: read, write, and execute. Read determines if members of a set can read a file or directory. Write determines if members of a set can write data to a file or directory. Execute determines if members of a set can execute the file. A 1 in the bit grants permission. A 0 in the bit denies permission.
For example, the following illustration shows how to grant a user access to read from, write to, and execute a file and deny permission from the other two sets.
This structure is based on the UNIX permission bits that govern read, write, and execute permissions for users, groups, and others. The Windows and Macintosh platforms access these permission settings differently.
Windows You can set permissions for files, but LabVIEW ignores permissions for directories. You cannot set permissions for groups or others. You can use only bit 7 to set permissions for users. If bit 7 is 0, LabVIEW denies the user write access, preventing the user from saving any changes to the file.
Macintosh You can set permissions for directories and files. When you set file permissions, you can use only bit 7. If bit 7 is 0, LabVIEW denies the user write access, preventing the user from saving any changes to the file. The read, write, and execute categories correspond to the See Files, Make Changes, and See Folders access rights, respectively.
The value you enter in permissions depends on the platform you use and which permissions you want to set for a group. Use the octal numeric format to enter a value for permissions, which you access by right-clicking the permissions control or constant, selecting Format & Precision to display the Format & Precision dialog box, and selecting Octal from the Format pull-down menu. Windows You can use only bit 7, the user write permission bit. To make a file read-only, enter the octal value 400 in permissions, which corresponds to the binary representation 100000000.
UNIX To give users read, write, and execute permissions, but deny these permissions to groups and others, enter the octal value 700, which corresponds to the binary representation 111000000.