PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Example: Identifying the attributes of a file found on an FTP server.
FTPAttribute (Example)
Example: Identifying the attributes of a file found on an FTP server.
This example is used to retrieve the date of the last modification and the attributes of the "Readme.txt" file found on the "ftp.cdrom.com" FTP site. The attributes are retrieved without specifying the name of the file to avoid a new request to the server.
Remark: The second syntax used to retrieve the attributes of a specific file is presented in comments.
GLOBAL
nConnection is int
// Connection to the FTP site
nConnection = FTPConnect("ftp.cdrom.com")
 
// Retrieve the date of the "Readme.txt" file
sDate is string
sDate = FTPDate(nConnection, "Readme.txt")
 
// Retrieve the attributes of the file
// Syntax 1: avoids a second request to the server
sAttribute is string
sAttribute = FTPAttribute()
// Or
// Syntax 2: a new request is sent to the server
// sAttribute = FTPAttribute(nConnection, "Readme.txt")
 
// IF "R" appears in the file attributes, a message is displayed
IF Position(sAttribute, "R") <> 0 THEN
Info("This file is read only")
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment