Mark the file or directory indicated in the path so that only read operations on it are allowed.
1 file.setReadOnly
<file.setReadOnly>
<file /> !
</file.setReadOnly>
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Efile | file |
Returns | |
---|---|
Type | Description |
Boolean | Returns true if the priviledge has been granted successfully. |
Example
Change the licenses to readonly of a file.
Copy
<xsql-script name='file_setReadOnly_sample1'> <body> <set name='m_path'> <string>c:<file.separator />tmp<file.separator />source<file.separator />deister.txt</string> </set> <if> <expr> <file.setReadOnly> <file name='#m_path' type='absolute' /> </file.setReadOnly> </expr> <then> <set name='m_result'>has been changed to ReadOnly</set> </then> <else> <set name='m_result'>is ReadOnly</set> </else> </if> <println><m_path/> <m_result/></println> </body> </xsql-script>
c:\tmp\source\deister.txt has been changed to ReadOnly.