FileAttr$

File management function.

The FileAttr$ function retrieves the attributes of the specified file name.

Syntax

var$=FileAttr$(<filename>)

Parameters

<filename>: string, file name or directory name of the object whose attributes will be retrieved. UNC names are accepted (such as "\\serv\home\dir 1\as3.txt").

Return value

var$, string, contains the attributes of the object:

N

No attribute

D

directory

R

read only

H

hidden

A

archive

S

system

Remarks

If an error occurs at execution (object not found, ...), standard error management is used; if #IgnoreErrors=1, an empty string is returned in case of an error.

See also

DirTree

Example

 

filename$="c:\program files\wintask\logs\untitled1.log"

attr$=FileAttr$(filename$)

msgbox(attr$)