swirl
Guide to OmniMark 7   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
      Other Library Functions  
function  

vfs.change-permissions

 
 

Library: General, File system utilities (OMVFS)
Import: omvfs.xmd

Declaration

  export external function change-permissions
                  value stream  path
        on        value directory  on-dir   optional
        to        value integer    mode
        modifying value integer    mask     optional
        contents  value switch     contents optional
                                            initial {contents-not-included}

Argument definitions

path
The file or directory whose permissions are to be changed.
on-dir
A vfs.directory object. If a vfs.directory object is specified the path parameter is relative to the vfs.directory and must be expressed as a relative URL.
mode
A union of the permissions to be set.
mask
is a union of the permissions to be modified.
contents
Specifies whether the permissions of the content of a directory are also to be changed. Values are vfs.contents-included or vfs.content-not-included. The default is vfs.contents-not-included.


Purpose

You can use vfs.change-permissions to set or alter the permissions of a file or directory.

The following program sets the file "myfile.txt" to be readable by everybody, but only writable by its owner and other group members.

  import "omvfs.xmd" prefixed by vfs.
  process
  vfs.change-permissions "myfile.txt"
    to (vfs.permit-all-read union vfs.permit-user-write union vfs.permit-group-write)

The following program turns off the archive attribute of directory "testdir" and all its contents.

  import "omvfs.xmd" prefixed by vfs.
  process
  vfs.change-permissions "testdir" to 0 modifying vfs.permit-archive
     contents vfs.contents-included

The following constants are usable for the mode and mask parameters. Multiple attributes can be set at once by creating a union.

Notes

If any of permit-user-write, permit-group-write and permit-other-write is set on Windows, then they are all set due to OS limitations.

Some UNIX systems do not allow non-root users to set permit-sticky.

Attributes not supported by a particular OS will be ignored.

If mask is not specified, then the target's permissions are changed to match those specified in mode.

If mask is specified, then only the permissions specified in the mask will be modified to the matching values in mode.

If contents is set to contents-included and the target is a directory, then the directory along with its contents will be changed recursively to the specified permissions.

Exceptions

The following exceptions may occur:

        Other Library Functions
   vfs.change-directory
   vfs.change-owner
   vfs.change-permissions
   vfs.close
   vfs.connect
   vfs.connect-directory
   vfs.copy
   vfs.cursor-position
   vfs.default-certificates-file
   vfs.delete-directory
   vfs.delete-file
   vfs.describe
   vfs.describe-file
   vfs.directory
   vfs.directory-name
   vfs.disconnect
   vfs.file
   vfs.file-directory
   vfs.file-name
   vfs.link
   vfs.list
   vfs.lock
   vfs.make-directory
   vfs.move
   vfs.move-cursor
   vfs.omvfs-version
   vfs.open
   vfs.open-file-system
   vfs.open-ftp
   vfs.open-http
   vfs.open-https
   vfs.reader
   vfs.set-default-certificates-file
   vfs.truncate
   vfs.unlock
   vfs.writer
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACYLIBRARIES ] [ ERRORS ]

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:46:00 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.