''GetAttr'' Function

Top  Previous  Next

Returns the attributes of the specified file or directory.

Syntax

GetAttr(file-or-directory-name, attributes)

 

Parameters

file-or-directory-name

The file of directory name that the attributes of it are required.

attributes

The File Attributes that are requested. Information about more than one file attribute can be requested by separating them with commas. The values of the attributes are dumped to pool variables or to process record fields depending on the definition.
 
If in the definition only the name of the file attribute is given, the value of the attribute is transferred to a pool variable whose name is the same as the attribute name. If you want that the name of the pool variable is different than the attribute name or the value is transferred to a process record field instead of a pool variable then you can use the "as" keyword right after the file attribute name followed by the name of the target variable or field name.

 
See Absolute or Relative Names.
 

Examples:

@// Transfer the name and the size of a file whose name is 

@// defined absolute to pool variables NAME and SIZE

GetAttr('c:\documents\customers.doc','NAME, SIZE') 

 

@// Transfer the full name to pool variable "FN" and the last modification date 

@// to process record field "LASTMOD" of the file whose name is

@// contained in process record field "FILE_NAME". 

GetAttr(f:FILE_NAME,'FULLNAME as v:FN, MODTIME as f:LASTMOD')