|
|||||
|
||||||
Related Topics | Other Library Functions |
function |
vfs.describe |
Library: File system utilities (OMVFS)
Import: omvfs.xmd |
export external function describe value string path on value directory on-dir optional into write-only string attributes
Argument definitions
You can use vfs.describe
to obtain a description of a file or a directory.
The attributes shelf returned by this function contains the following keyed items.
The following program prints out the attributes of the specified directory and interprets the "permissions" attribute to determine if user writing is permitted:
import "omvfs.xmd" prefixed by vfs. process local string attr variable vfs.describe "c:\foo\bar\" into attr repeat over attr output key of attr || ": " || attr || "%n" again do when attr{"isdir"} = 1 output "This is a directory%n" else output "This is a file%n" done output "User write permission: " do when attr{"permissions"} mask vfs.permit-user-write > 0 output "YES%n" else output "NO%n" done
You can determine the value of any one permission by masking the value of the "permissions" attribute with the appropriate vfs permission constant. These constants are described in vfs.change-permissions
. If the value returned is 0 then the permission is not set. If a non-zero value is returned, the permission is set.
The following exceptions may occur:
If the drive containing the file or directory being described is a read-only drive (for example, a CD-ROM), the atime may be zero.
If a particular attribute item is not supported by a the file system protocol you are using, it is returned as an empty string.
Copyright © Stilo International plc, 1988-2010.