Programming with Reflection

image\rwnprg32.gif 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.



Meaning\Syntax Example


<octal value>

Sets the "mode" value.



Set user ID on execution.



Set group ID on execution.



Sticky bit.



Owner has read permission.



Owner has write permission.



Owner has execute permission.



Group has read permission.



Group has write permission.



Group has execute permission.



Others have read permission.



Others have write permission.



Others have execute permission.

"-m 0777" gives the owner, group, and others
read, write, and execute permissions.



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"



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.



image\jump.gif Example

image\popup.gif Related Topics