Tag Link | [File_Chmod] | Category | File |
---|---|---|---|
Type | Process | Source Available | No |
Support | Preferred | Version | 7.0 |
Change | Unchanged | Data Source | Any |
Output Type | None | Security | File |
Implementation | Internal | Sets | Lasso 8.5, Lasso 8.0, Lasso 7.0 |
[File_Chmod] allows the Unix file permissions of a file to be modified. Requires the name and path to the file to be modified, and the new permission sequence as parameters.
The permissions can be specified in several different ways:
- Octal permissions can be specified as a four digit string such as '0777' or '0444'. The octal string should be in the same format used for chmod on the command line.
- Symbolic permissions can be specified using four named parameters
- A Decimal or Hexadecimal value (without quotes) can also be used.
For more information on how chmod permission sequences are interpreted please consult the documentation for your operating system. Some of the details are system dependent.
Note: This tag is currently supported on Mac OS X and Linux.
[File_Chmod: File, Permission Sequence]
<?LassoScript
File_Chmod: '/folder/filename.txt', '0777'; // octal (quoted)
File_Chmod: '/folder/filename.txt',
File_Chmod: '/folder/filename.txt',
File_Chmod: '/folder/filename.txt',
File_Chmod: '/folder/filename.txt', 511; // decimal
File_Chmod: '/folder/filename.txt', 0x1f; // hex
?>
Required Parameters | |
---|---|
File | The name and path to the file to be modified. |
Permission Sequence | Decimal or hex chmod permission sequence. |
Optional Parameters | |
-a | Permissions for all users (rwxst). |
-u | Permissions for file owner (rwx). |
-g | Permissions for file group (rwx). |
-o | Permissions for other users (rwx). |
In 7.0.3 the octal and symbolic options were added. Note that octal permissions need to be quoted since octal integers are not directly interpreted by Lasso.
To change the Unix file permissons of a file:
Use the [File_Chmod] tag. The following example changes the Unix file system permissions of a file to
[File_Chmod: 'myfile.txt',
Substitution | ||
---|---|---|
|
|
|