|
This command returns a string array which contains a list of files and directories in the current working directory. This version of the FtpDir$() command returns all the information about a file.
Here is an example of how to display a list of all the files and directories:
dim d$(0)
' Get a list of files and directories current FTP server directory.
d$() = FtpDirFull$(1)
if d$(0) = "" then
Print "No Files Returned"
else
' Display a list of the results
List d$(), f$
endif
Each element in the array is a delimited string. The delimiter character is a return character "\n". Directory entries are preceeded by a "/".
One element of the directory list would appear as follows:
readme.txt - filename
4264 - file size in bytes
1333972920000 - file last modified date in UTC time code
4380385 - owner id
604 - file permissions
This is how you would extract the values for one directory entry.
name$ = ItemExtract$(d$(1),0,"\n")
size = val(ItemExtract$(d$(1),1,"\n"))
time = val(ItemExtract$(d$(1),2,"\n"))
owner$ = ItemExtract$(d$(1),3,"\n")
permissions$ = ItemExtract$(d$(1),4,"\n")
|