GetFindFileSize

GetFindFileSize retrieves the file size of the currently matched file after a successful call to either FindFirstFile or FindNextFile methods.

When FindFileClose is called, GetFindFileName, GetFindFileSize and GetFindFileAttributes should not be used since this will make the Scripting engine fail.

Syntax

GetFileSize

Returns

Long Integer containing the file size.

Example

An example of RenameFile function in the FTPA protocol used to transfer files between network computers. Object. Renames all files found in the root of the FTP server:

Function Main

Dim FTPobj as Object

Const DIRECTORYMASK=&H10

ip = "127.0.0.1"

port = 21

cr = Chr(13) + Chr(10)

Set FTPobj = FTP.Connect (ip,port,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 & cr

Found=FTPobj.FindNextFile

Wend

End Function