|Type||Topic||Plugin||Version||macOS||Windows||Linux||Console & Web||iOS|
|class||Network||MBS Network Plugin||4.1||Yes||Yes||Yes||Yes||No|
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."
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.
- 9 properties
- method Parse(line as string) as boolean
This class has no sub classes.
The items on this page are in the following plugins: MBS Network Plugin.
MBS Xojo Plugins