Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
39
Task/FTP/LiveCode/ftp.livecode
Normal file
39
Task/FTP/LiveCode/ftp.livecode
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
libURLSetFTPMode "passive" --default is passive anyway
|
||||
put url "ftp://ftp.hq.nasa.gov/" into listing
|
||||
repeat for each line ftpln in listing
|
||||
set itemdel to space
|
||||
if the first char of (the first item of ftpln) is "d" then
|
||||
-- is a directory
|
||||
put the last item of ftpln after dirlist
|
||||
else
|
||||
put the last item of ftpln after filelist
|
||||
end if
|
||||
end repeat
|
||||
|
||||
put listing //(subset)
|
||||
// -rw-r--r-- 1 ftpadmin ftp-adm 3997 May 26 1998 README
|
||||
// drwxrwsr-x 17 ftpadmin ftp-adm 4096 Sep 10 16:08 pub
|
||||
|
||||
put dirlist
|
||||
// armd
|
||||
// chmgt
|
||||
// incoming
|
||||
// lost+found
|
||||
// office
|
||||
// pub
|
||||
|
||||
put filelist
|
||||
// README
|
||||
// ftp-exec
|
||||
// index.html
|
||||
// robots.txt
|
||||
|
||||
-- downloading a file (upload is same, but use put)
|
||||
-- you don't have to cd manually
|
||||
-- file up/down transfer is binary in livecode (always enforced by livecode)
|
||||
put URL "ftp://ftp.hq.nasa.gov/pub/robots.txt" into URL "file:myFile.txt"
|
||||
|
||||
You can execute any ftp command using the libURLftpCommand command
|
||||
e.g. to know the working directory, issue "pwd", we could issue "list" for above too,
|
||||
but using an url with slash on the end with the ftp protocol causes a dir listing by default.
|
||||
put libURLftpCommand("PWD",ftp.example.org)
|
||||
Loading…
Add table
Add a link
Reference in a new issue