12.13. Setting file parameters

[<<<] [>>>]

Files usually have parameters in addition to the information contained in the file itself. Such information is the owner of the file, the group the file belongs to, creation time, modify time, access time, change time and so on. To set these parameters of a file ScriptBasic provides the command set file.

The syntax of the command is

set file filename parameter=value

where `filename' is the name of the file for which the parameter is to be set, the parameter is the name of the parameter to change and value is the desired value of the parameter.

The parameter can be

If the file does not exist or some other condition prevents the successful change of the parameter the program generates an error with one of the error codes sbErrorSetCreateTime, sbErrorSetModifyTime, sbErrorSetAccessTime.

Note that Windows NT file system (NTFS) and UNIX operating systems store file time values in GMT. Do not forget to convert the local time to GMT if needed when changing some of the file time values. Other file systems, like FAT may store the file times as local time. Be careful.


[<<<] [>>>]