diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-03-22 04:15:03 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-03-22 04:15:03 +0000 |
commit | 1fa65d89ca5dc64756f7933d7cc3f524e4627dce (patch) | |
tree | df614c8b86b0f7c2f45c2afcacc993ab3c0dcf11 /etc/get.lua | |
parent | 4919a83d2271a9e43b83c7d488e3f94c850681e3 (diff) | |
download | luasocket-1fa65d89ca5dc64756f7933d7cc3f524e4627dce.tar.gz luasocket-1fa65d89ca5dc64756f7933d7cc3f524e4627dce.tar.bz2 luasocket-1fa65d89ca5dc64756f7933d7cc3f524e4627dce.zip |
Adjusted some details, got rid of old files, added some new.
Diffstat (limited to 'etc/get.lua')
-rw-r--r-- | etc/get.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/etc/get.lua b/etc/get.lua index 0306b54..eafebda 100644 --- a/etc/get.lua +++ b/etc/get.lua | |||
@@ -93,7 +93,7 @@ function getbyhttp(url, file) | |||
93 | local save = ltn12.sink.file(file or io.stdout) | 93 | local save = ltn12.sink.file(file or io.stdout) |
94 | -- only print feedback if output is not stdout | 94 | -- only print feedback if output is not stdout |
95 | if file then save = ltn12.sink.chain(stats(gethttpsize(url)), save) end | 95 | if file then save = ltn12.sink.chain(stats(gethttpsize(url)), save) end |
96 | local respt = socket.http.request_cb({url = url, sink = save}) | 96 | local respt = socket.http.request {url = url, sink = save } |
97 | if respt.code ~= 200 then print(respt.status or respt.error) end | 97 | if respt.code ~= 200 then print(respt.status or respt.error) end |
98 | end | 98 | end |
99 | 99 | ||
@@ -103,7 +103,7 @@ function getbyftp(url, file) | |||
103 | -- only print feedback if output is not stdout | 103 | -- only print feedback if output is not stdout |
104 | -- and we don't know how big the file is | 104 | -- and we don't know how big the file is |
105 | if file then save = ltn12.sink.chain(stats(), save) end | 105 | if file then save = ltn12.sink.chain(stats(), save) end |
106 | local ret, err = socket.ftp.get_cb {url = url, sink = save, type = "i"} | 106 | local ret, err = socket.ftp.get {url = url, sink = save, type = "i"} |
107 | if err then print(err) end | 107 | if err then print(err) end |
108 | end | 108 | end |
109 | 109 | ||