FTP listing using "libURLftpCommand"

Björnke von Gierke bvg at mac.com
Mon Jan 18 19:01:51 EST 2010


generally, you can go to ftp directories, and get a rev-like listing:

put "ftp://user:pass@host.com/directory/" into theListOfFiles

if you know that and still want to use the list command yourself, then i suggest to use shell, because rev doesn't open the data connection for you, and it seems you need that for file listings. (ftp has a data and a command port, and some servers need you to use both, this can be controlled by active and passive mode (via liburlsetftpmode), but for what you're trying that's not much help anyway). Seriously, i've looked into this once, and am now glad to know that I never will need to implement it myself, thus i suggest again:

put "ftp://user:pass@host.com/directory/" into theListOfFiles

finally, note that setting the liburlftplistcommand is useless if you use liburlftpcommand to get listings of files "by hand"(basically liburlftpcommand is more of an internal handler, and using it forfaits a few build in things).


On 19 Jan 2010, at 00:37, stephen barncard wrote:

> I'd like to use the LIST command and get a decent directory listing using
> the FTP library. Yes I know about parsing a HTML listing of a directory and
> it really is incomplete (like year information).
> 
> Currently only some of the libURL ftp commands work with the ON-REV ftp
> setup, which  a piece of Open Source called "Pure-FTPd -
> http://pureftpd.org/"
> 
> HELP    returns {   214 Pure-FTPd - http://pureftpd.org/   }
> LIST "/"     returns   {  425 No data connection   }
> PWD     returns  {   "/"    }
> SYST    returns  {   215 UNIX Type: L8  }
> 
> 
> 
> Has anyone used LIBURL successfully trying to gain control of the other FTP
> commands, especially LIST?
> 
> here's the simple code:
> 
> 
> on mouseup
> 
>      get returnAffectedFieldName()
> 
>      put it into tObject
> 
>      put "LIST"  into ftpCommandLine
> 
>      libURLSetFTPListCommand "LIST"
> 
>      get  libURLftpCommand(ftpCommandLine,kFTPAdr,kLogin,kPasw)
> 
>      put it into fld tObject
> 
> end mouseup
> 
> 
> We really need more examples in the docs.  Or is this broken? Help, please,
> Dave Cragg.
> 
> 
> -------------------------
> Stephen Barncard
> San Francisco
> http://houseofcubes.com/disco.irev
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list