GetFindFileAttributes

GetFindFileAttributes recupera los atributos de archivo del archivo coincidente actual después de una solicitud exitosa a los métodos FindFirstFile o FindNextFile.

Cuando se solicita FindFileClose, GetFindFileName, GetFindFileSize y GetFindFileAttributes no se deben utilizar debido a que esto ocasionará un error en el motor de Scripting.

Sintaxis

GetFindFileAttributes

Devolución

Atributos de archivo del archivo coincidente actual. Estos son los atributos del miembro dwFileAttributes en la estructura WIN32 definida WIN32_FIND_DATA. Las máscaras de bits se definen como constantes FILE_ATTRUTE_*. Es decir, FILE_ATTRUTE_DIRECTORY se define como 0x10.

Máscaras de bits Definición
FILE_ATTRIBUTE_READONLY

&H1

FILE_ATTRIBUTE_HIDDEN

&H2

FILE_ATTRIBUTE_SYSTEM

&H4

FILE_ATTRIBUTE_DIRECTORY

&H10

FILE_ATTRIBUTE_ARCHIVE

&H20

FILE_ATTRIBUTE_DEVICE

&H40

FILE_ATTRIBUTE_NORMAL

&H80

FILE_ATTRIBUTE_TEMPORARY

&H100

FILE_ATTRIBUTE_SPARSE_FILE

&H200

FILE_ATTRIBUTE_REPARSE_POINT

&H400

FILE_ATTRIBUTE_COMPRESSED

&H800

FILE_ATTRIBUTE_OFFLINE

&H1000

FILE_ATTRIBUTE_NOT_CONTENT_INDEXED

&H2000

FILE_ATTRIBUTE_ENCRYPTED

&H4000

Ejemplo

Un ejemplo de la función RenameFile en el objeto FTPProtocolo que se utiliza para transferir archivos entre equipos de redes.. Cambia el nombre de todos los archivos hallados en la raíz del servidor FTP:

Function Main

Dim FTPobj as Object

Const DIRECTORYMASK=&H10

ip = "127.0.0.1"

port = 21

Set FTPobj = FTP.Connect (ip,puerto,TRUE,"anonymous","lnss@gfi.com")

Found=FTPobj.FindFirstFile("*")

While Found

If (FTPobj.GetFindFileAttributes And DIRECTORYMASK) = DIRECTORYMASK Then

FileType="directory"

Else

FileType="file"

End If

echo "File: " + FTPobj.GetFindFileName + " size: " + CStr(FTPobj.GetFindFileSize) + " bytes type: " + FileType

Found=FTPobj.FindNextFile

Wend

End Function