[update 27Mar2022 - attached updated FTP dll - just backup your old one and copy/paste in compiler / plugins ]
This is also on the snippets board but thought I should put it here just in case it goes into a void.
So, I updated the github source code to fix the GET FTP DIR$() command that returns a blank. this is because the code does nothing in function FTP_GetDir just returns a FALSE value. not very useful.
Anyway I added code that calls the wininet.dll function FtpGetCurrentDirectory and works perfectly.
so attached is the updated dll if anyone is interested. also I attach a code snippet for you to try out using an anonymous FTP site. backup your original dll, even though there are no crashes or issues that I have found.
remstart
uses fixed FTP dll containing fixed DBPro command FTP GET DIR$()
remend
sync on : sync rate 30 : sync
//ftp.lpl.arizona.edu/pub/lpl/
url$="ftp.lpl.arizona.edu"
ftp connect url$,"anonymous","",1
success = get ftp failure()
print success
if success = 1
print GET FTP ERROR$()
else
print "connected ok to ";url$;"."
endif
ftp set dir "pub/lpl/"
print "current ftp dir: ";get ftp dir$()
ftp find first
while get ftp file type()>-1
print "Type:";get ftp file type();
print " Name:";get ftp file name$();
print " Size:";get ftp file size();
print " create TS: ";GET FTP FILE CREATETS$();
print " access TS: ";GET FTP FILE ACCESSTS$();
print " mod TS: ";GET FTP FILE MODTS$()
ftp find next
endwhile
ftp set dir "pc_utils"
print "current ftp dir: ";get ftp dir$()
ftp find first
while get ftp file type()>-1
print "Type:";get ftp file type();
print " Name:";get ftp file name$();
print " Size:";get ftp file size();
print " create TS: ";GET FTP FILE CREATETS$();
print " access TS: ";GET FTP FILE ACCESSTS$();
print " mod TS: ";GET FTP FILE MODTS$()
ftp find next
endwhile
ftp disconnect
sync
wait key
end
I've also added as an extra an updated memblocks dll that allows up to 10000 memblocks instead of the 255 limit. this will depend on how much memory your PC/laptop has so use wisely. I filled all 10000 memblocks but kept the memory used for each one quite small. have a play , and any feedback welcome.
[update - added new version of the FTP dll - better cleanup code]
Pro Programmer / Data Scientist, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others