Enumerates the files and directories on a remote FTP host.
Returns the attributes of a file or directory.
object.Attributes
String.
Read-only.
This example returns the attributes of the file log.txt.
set ftpmgr = createobject ("ucx:ftpfilemgr")
ftpmgr.server = "193.97.54.165"
ftpmgr.login ("User", "password")
set entry = ftpmgr.findentry ("/home/user/log.txt")
print ("File name : " &entry.name &"File attributes: " &entry.attributes)
ftpmgr.logout()
Determines whether or not the Entry object is a directory.
object.Directory
Boolean.
Read-only.
If the object is a directory, this property returns a message indicating so; otherwise, it returns a message indicating that the object is a file.
This example returns the message "log is a directory" if the object log is a directory; otherwise, it returns the message "log is a file".
set ftpmgr = createobject ("ucx:ftpfilemgr")
ftpmgr.server = "193.97.54.165"
ftpmgr.login ("User", "password")
set entry = ftpmgr.findentry ("/home/user/log")
if (entry.directory) then
print (entry.name &" is a directory")
else
print (entry.name &" is a file")
end if
ftpmgr.logout()
Returns the date the Entry object (file or directory) was last modified.
object.ModifyDate
Date.
Read-only.
This example returns the date the file log.txt was last modified.
set ftpmgr = createobject ("ucx:ftpfilemgr")
ftpmgr.server = "193.97.54.165"
ftpmgr.login ("User", "password")
set entry = ftpmgr.findentry ("/home/user/log")
print ("File name: " &entry.name &"File Modification Date: " &entry.ModifyDate)
ftpmgr.logout()
Sets or returns the name of a file or directory.
object.Name[=NewName As String]
String.
Read/write.
NewName is an optional parameter that sets the name of the file or directory.
This example returns the name of the file log.txt.
set ftpmgr = createobject ("ucx:ftpfilemgr")
ftpmgr.server = "193.97.54.165"
ftpmgr.login ("User", "password")
set entry = ftpmgr.findentry ("/home/user/log.txt")
print ("File name : " &entry.name &"File Attributes: " &entry.attributes)
ftpmgr.logout()
Returns the owner of a file or directory.
object.Owner
String.
Read-only.
This example returns the owner of the file log.txt.
set ftpmgr = createobject ("ucx:ftpfilemgr")
ftpmgr.server = "193.97.54.165"
ftpmgr.login ("User", "password")
set entry = ftpmgr.findentry ("/home/user/log.txt")
print ("File name : " &entry.name &"File owner: " &entry.owner)
ftpmgr.logout()
Returns the size of a file.
object.Size
String.
Read-only.
If the object is a directory, this property returns 0 (zero).
This example returns the size of the file log.txt.
set ftpmgr = createobject ("ucx:ftpfilemgr")
ftpmgr.server = "193.97.54.165"
ftpmgr.login ("User", "password")
set entry = ftpmgr.findentry ("/home/user/log.txt")
print ("File name: " &entry.name &"File size: " &entry.size)
ftpmgr.logout()
Returns child entries of a directory.
object.GetChildren(
[NameFilter As String],
[TypeFilter As Integer])
Directory Entry Filter Constants. The default is DIR_OPT_ALL.
Entries. If the current object is a directory, this method returns its child entries. If it is a file, it returns NULL.
If the current object is a directory, this example returns its child Entries. If it is a file, this example returns NULL
’NSN example to print the details of files and directories on the remote host
set ftpmgr = createobject ("ucx:ftpfilemgr")
ftpmgr.server = "193.97.54.165"
ftpmgr.login ("User", "password")
set currentDir = ftpmgr.currentDir
set entries = currentDir.getchildren()
entries.reset
while (entries.hasmoreelements)
set Entry=entries.next
print (entry.name &" " &entry.modifydate)
wend
ftpmgr.logout()