MBS Xojo Developer Conference and Training
Join us from 3rd to 6th May 2017 in Berlin, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

FTPParseMBS class

class, Network, MBS Network Plugin (FTPParse), class FTPParseMBS,
Plugin version: 4.1, Mac: Yes, Win: Yes, Linux: Yes, Console & Web: Yes, Feedback.

Function: A class for parsing FTP LIST responses.
dim f as new FTPParseMBS

if f.Parse("drwxr-xr-x 2 lefregole nobody 4096 May 30 2011 Downloads") then
if f.ModificationTimeType <> 0 then

dim d as new date(1970,1,1,0,0,0)

d.TotalSeconds = d.TotalSeconds+ f.ModificationTime

MsgBox f.Name+" has "+str(f.Size)+" bytes: "+d.ShortDate
MsgBox f.Name+" has "+str(f.Size)+" bytes."
end if
An implementation of the ftpparse code from <http://cr.yp.to/ftpparse.html>.
Works only for ASCII text.

What is it?
ftpparse is a library for parsing FTP LIST responses.

ftpparse currently understands the LIST output from any UNIX server, Microsoft FTP Service, Windows NT FTP Server, VMS, WFTPD, NetPresenz, NetWare, and MSDOS. It also supports EPLF, a solution to the LIST-parsing mess.

ftpparse parses file modification times into time_t, so you can easily compare them and display them in your favorite format. It lets you know how precise the time_t is: LOCAL meaning exact with known time zone (available from EPLF), REMOTEMINUTE meaning unknown time zone and seconds, or REMOTEDAY meaning unknown time zone and time of day.

To use ftpparse, simply feed each line of LIST output to the ftpparse() routine, along with a pointer to a struct ftpparse. If ftpparse() returns 1, you can find a filename and various other useful information inside the struct ftpparse.

Commercial use of ftpparse is fine, as long as you let me know what programs you're using it in.

This class has no sub classes.

The items on this page are in the following plugins: MBS Network Plugin.

FSEventsMBS   -   GameKitMBS

MBS Xojo PDF Plugins