FTP listing using "libURLftpCommand"

Luis luis at anachreon.co.uk
Tue Jan 19 05:32:55 EST 2010


Hiya,

If the year isn't LISTed then assume the current year. You can also  
parse for ':' and any that don't have it have the year...

Other than that, the LIST command should take a filename ('LIST  
filename') and return full information, so you could parse the return  
from LIST and then pump through the filenames (those that have a ':').

Cheers,

Luis.


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

> Thanks...this sort of works.....  the example needs to use the URL  
> keyword
> though
>
> put URL ("ftp://user:pass@host.com/directory/") into theListOfFiles
>
> this does list ok, similar listing to the HTTP method, however the  
> dates in
> the listing are not consistent.
>
> drwxr-x---   21 sbarncar 99           4096 Dec 31 03:03 .
>
> drwx--x--x   15 sbarncar sbarncar     4096 Jan 15 01:51 ..
>
> -rw-r--r--    1 sbarncar sbarncar        0 Dec 30 12:06 .htaccess
>
> drwxr-xr-x    2 sbarncar sbarncar     4096 Jul 11  2009 .smileys
>
> drwxr-xr-x   12 sbarncar sbarncar     4096 Jun 20  2009 barncard
>
> drwxr-xr-x    2 sbarncar sbarncar     4096 Dec 22 03:35 blasters
>
>
> Some directories have the year, and some just have the month and  
> day. Is
> this just the way it is? The year is just not important?
>
> I wonder how Transmit and other FTP clients get this date info  
> correctly?
>
> sqb
> -------------------------
> Stephen Barncard
> San Francisco
> http://houseofcubes.com/disco.irev
>
>
> 2010/1/18 Björnke von Gierke <bvg at mac.com>
>
>> 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
>>
>> _______________________________________________
>> 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
>>
> _______________________________________________
> 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