SetAttr Statement

Configura la información d'atributu d'un ficheru especificáu.

Syntax:


SetAttr PathName As String, Attributes As Integer

Parameters:

FileName: Name of the file, including the path, that you want to test attributes of. If you do not enter a path, SetAttr searches for the file in the current directory. You can also use URL notation.

Attributes: Bit pattern defining the attributes that you want to set or to clear:

Named constant

Valor

Definición

ATTR_NORMAL

0

Ficheros normales.

ATTR_READONLY

1

Ficheros namái de llectura.

ATTR_HIDDEN

2

Ficheru anubríu


Pue establecer dellos atributos combinando los valores respectivos con una instrucción OR lóxica.

Error codes:

5 Llamada a procedimientu non válida

53 Ficheru non atopáu

70 Accesu refugáu

Example:


Sub ExampleSetGetAttr
 On Fallu Goto RemanadorError ' Define destín pal xestor de fallos
 If Dir("C:\test",16)="" Then MkDir "C:\test"
 If Dir("C:\test\autoexec.sav")="" Then FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav"
 SetAttr "c:\test\autoexec.sav" ,0
 FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav"
 SetAttr "c:\test\autoexec.sav" , ATTR_READONLY
 Print GetAttr( "c:\test\autoexec.sav" )
 End
ErrorHandler:
 Print Error
 End
End Sub

Please support us!