From f97dc8489d58aef2d038288f9a8bc69f907e17bb Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Tue, 22 Mar 2022 19:21:58 +0100 Subject: fix(docs) fix html linter issues in the docs (#358) --- doc/ftp.html | 122 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 61 insertions(+), 61 deletions(-) (limited to 'doc/ftp.html') diff --git a/doc/ftp.html b/doc/ftp.html index 091c88f..7f7da2e 100644 --- a/doc/ftp.html +++ b/doc/ftp.html @@ -1,5 +1,5 @@ - + @@ -13,22 +13,22 @@ -
+

- -
-LuaSocket +
+LuaSocket
Network support for the Lua language +
Network support for the Lua language
-

+

home · download · installation · introduction · -reference +reference


@@ -36,7 +36,7 @@ -

FTP

+

FTP

FTP (File Transfer Protocol) is a protocol used to transfer files @@ -50,28 +50,28 @@ High level functions are provided supporting the most common operations. These high level functions are implemented on top of a lower level interface. Using the low-level interface, users can easily create their own functions to access any operation supported by the FTP -protocol. For that, check the implementation. +protocol. For that, check the implementation.

-To really benefit from this module, a good understanding of +To really benefit from this module, a good understanding of -LTN012, Filters sources and sinks is necessary. +LTN012, Filters sources and sinks is necessary.

-

+

To obtain the ftp namespace, run:

-
+
 -- loads the FTP module and any libraries it requires
 local ftp = require("socket.ftp")
 

URLs MUST conform to -RFC 1738, -that is, an URL is a string in the form: +RFC 1738, +that is, an URL is a string in the form:

@@ -81,19 +81,19 @@ that is, an URL is a string in the form:

The following constants in the namespace can be set to control the default behavior of -the FTP module: +the FTP module:

    -
  • PASSWORD: default anonymous password. -
  • TIMEOUT: sets the timeout for all I/O operations; -
  • USER: default anonymous user; +
  • PASSWORD: default anonymous password.
  • +
  • TIMEOUT: sets the timeout for all I/O operations;
  • +
  • USER: default anonymous user;
-

+

ftp.get(url)
ftp.get{
  host = string,
@@ -109,19 +109,19 @@ ftp.get{
}

-

+

The get function has two forms. The simple form has fixed functionality: it downloads the contents of a URL and returns it as a string. The generic form allows a lot more control, as explained below.

-

+

If the argument of the get function is a table, the function -expects at least the fields host, sink, and one of +expects at least the fields host, sink, and one of argument or path (argument takes precedence). Host is the server to connect to. Sink is -the simple +the simple LTN12 sink that will receive the downloaded data. Argument or path give the target path to the resource in the server. The @@ -129,28 +129,28 @@ optional arguments are the following:

  • user, password: User name and password used for -authentication. Defaults to "ftp:anonymous@anonymous.org"; +authentication. Defaults to "ftp:anonymous@anonymous.org";
  • command: The FTP command used to obtain data. Defaults to -"retr", but see example below; -
  • port: The port to used for the control connection. Defaults to 21; +"retr", but see example below;
  • +
  • port: The port to used for the control connection. Defaults to 21;
  • type: The transfer mode. Can take values "i" or -"a". Defaults to whatever is the server default; -
  • step: +"a". Defaults to whatever is the server default;
  • +
  • step: LTN12 pump step function used to pass data from the -server to the sink. Defaults to the LTN12 pump.step function; +server to the sink. Defaults to the LTN12 pump.step function;
  • create: An optional function to be used instead of -socket.tcp when the communications socket is created. +socket.tcp when the communications socket is created.
-

+

If successful, the simple version returns the URL contents as a string, and the generic function returns 1. In case of error, both functions return nil and an error message describing the -error. +error.

-
+
 -- load the ftp support
 local ftp = require("socket.ftp")
 
@@ -159,7 +159,7 @@ local ftp = require("socket.ftp")
 f, e = ftp.get("ftp://ftp.tecgraf.puc-rio.br/pub/lua/lua.tar.gz;type=i")
 
-
+
 -- load needed modules
 local ftp = require("socket.ftp")
 local ltn12 = require("ltn12")
@@ -178,7 +178,7 @@ end
 
 
 
-

+

ftp.put(url, content)
ftp.put{
  host = string,
@@ -194,57 +194,57 @@ ftp.put{
}

-

+

The put function has two forms. The simple form has fixed functionality: it uploads a string of content into a URL. The generic form -allows a lot more control, as explained below. +allows a lot more control, as explained below.

-

+

If the argument of the put function is a table, the function -expects at least the fields host, source, and one of +expects at least the fields host, source, and one of argument or path (argument takes precedence). Host is the server to connect to. Source is -the simple -LTN12 -source that will provide the contents to be uploaded. +the simple +LTN12 +source that will provide the contents to be uploaded. Argument or path give the target path to the resource in the server. The optional arguments are the following:

  • user, password: User name and password used for -authentication. Defaults to "ftp:anonymous@anonymous.org"; +authentication. Defaults to "ftp:anonymous@anonymous.org";
  • command: The FTP command used to send data. Defaults to -"stor", but see example below; -
  • port: The port to used for the control connection. Defaults to 21; +"stor", but see example below;
  • +
  • port: The port to used for the control connection. Defaults to 21;
  • type: The transfer mode. Can take values "i" or -"a". Defaults to whatever is the server default; -
  • step: -LTN12 +"a". Defaults to whatever is the server default;
  • +
  • step: +LTN12 pump step function used to pass data from the -server to the sink. Defaults to the LTN12 pump.step function; +server to the sink. Defaults to the LTN12 pump.step function;
  • create: An optional function to be used instead of -socket.tcp when the communications socket is created. +socket.tcp when the communications socket is created.
-

+

Both functions return 1 if successful, or nil and an error message describing the reason for failure.

-
+
 -- load the ftp support
 local ftp = require("socket.ftp")
 
 -- Log as user "fulano" on server "ftp.example.com",
--- using password "silva", and store a file "README" with contents 
+-- using password "silva", and store a file "README" with contents
 -- "wrong password, of course"
-f, e = ftp.put("ftp://fulano:silva@ftp.example.com/README", 
+f, e = ftp.put("ftp://fulano:silva@ftp.example.com/README",
     "wrong password, of course")
 
-
+
 -- load the ftp support
 local ftp = require("socket.ftp")
 local ltn12 = require("ltn12")
@@ -253,7 +253,7 @@ local ltn12 = require("ltn12")
 -- using password "silva", and append to the remote file "LOG", sending the
 -- contents of the local file "LOCAL-LOG"
 f, e = ftp.put{
-  host = "ftp.example.com", 
+  host = "ftp.example.com",
   user = "fulano",
   password = "silva",
   command = "appe",
@@ -265,15 +265,15 @@ f, e = ftp.put{
 
 
 
-