Programming with Reflection
UNIX Host File Attributes
The following table shows the valid UNIX host file attributes you can specify in the Attributes argument to the WRQSendFile method. The Attributes argument takes a string value, and therefore must be enclosed in quotation marks. Multiple attributes are separated by a space.
Attribute |
Value |
Meaning\Syntax Example |
-m |
<octal value> |
Sets the "mode" value. |
|
4000 |
Set user ID on execution. |
|
2000 |
Set group ID on execution. |
|
1000 |
Sticky bit. |
|
0400 |
Owner has read permission. |
|
0200 |
Owner has write permission. |
|
0100 |
Owner has execute permission. |
|
0040 |
Group has read permission. |
|
0020 |
Group has write permission. |
|
0010 |
Group has execute permission. |
|
0004 |
Others have read permission. |
|
0002 |
Others have write permission. |
|
0001 |
Others have execute permission. "-m 0777" gives the owner, group, and others |
-o |
<string> |
Specifies the owner for the file. The value specified must correspond to a valid login name or user ID in the specified group. "-o joant" |
-g |
<string> |
Specifies the group of the file's owner. The value specified must correspond to a valid group name or group ID on the UNIX host. "-g users" |
The mode value is determined by adding the values for the permissions you want to assign. For example, because "Owner has read permission" has a value of 0400 and "Owner has write permission" has a value of 0200, you would specify a mode value of 0600 (the sum of the two modes) to assign read and write permission to the owner of the file. To assign read, write, and execute permission for the owner, add 0400, 0200, and 0100 to get 0700. To assign full permissions for owner, read and write permissions for the group, and read and write permissions for others, add all relevant values, for a mode value of 0766.
The default mode setting is 0644 (read and write permission for the owner, read permission only for group and others). The default owner is the person logged in when the file is created or transferred to the host; the default group is the owner's login group.
Adding the "Set user ID on execution" value (4000) to the mode value when transferring an executable file specifies that the owner's permissions should determine access when the file is run, rather than the permissions of the person running the program. Adding the "Set group ID on execution" value (2000) specifies that the permissions of the login group of the person running the file should determine access as the file is running. See chmod (1) in your UNIX documentation for more information.