Mercurial > octave-nkf
annotate scripts/@ftp/ftp.m @ 10793:be55736a0783
Grammarcheck the documentation from m-files.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 18 Jul 2010 20:35:16 -0700 |
parents | fbd7843974fa |
children | 2c356a35d7f5 |
rev | line source |
---|---|
9880 | 1 ## Copyright (C) 2009 David Bateman |
2 ## | |
3 ## This program is free software; you can redistribute it and/or modify | |
4 ## it under the terms of the GNU General Public License as published by | |
5 ## the Free Software Foundation; either version 2 of the License, or | |
6 ## (at your option) any later version. | |
7 ## | |
8 ## This program is distributed in the hope that it will be useful, | |
9 ## but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 ## GNU General Public License for more details. | |
12 ## | |
13 ## You should have received a copy of the GNU General Public License | |
14 ## along with this program; If not, see <http://www.gnu.org/licenses/>. | |
15 | |
16 ## -*- texinfo -*- | |
10793
be55736a0783
Grammarcheck the documentation from m-files.
Rik <octave@nomad.inbox5.com>
parents:
10711
diff
changeset
|
17 ## @deftypefn {Function File} {@var{f}} = ftp (@var{host}) |
9880 | 18 ## @deftypefnx {Function File} {@var{f}} = ftp (@var{host}, @var{username}, ## @var{password}) |
19 ## Connect to the FTP server @var{host} with @var{username} and @var{password}. | |
20 ## If @var{username} and @var{password} are not specified, user "anonymous" | |
10711
fbd7843974fa
Periodic grammar check of documentation files to ensure common format.
Rik <octave@nomad.inbox5.com>
parents:
9897
diff
changeset
|
21 ## with no password is used. The returned FTP object @var{f} represents the |
9880 | 22 ## established FTP connection. |
23 ## @end deftypefn | |
24 | |
9897
4bf50a7d533b
fix for FTP object constructor. Allow basic operation with matlab FTP objects
David Bateman <dbateman@free.fr>
parents:
9880
diff
changeset
|
25 function obj = ftp (host, username = "anonymous", password = "") |
4bf50a7d533b
fix for FTP object constructor. Allow basic operation with matlab FTP objects
David Bateman <dbateman@free.fr>
parents:
9880
diff
changeset
|
26 if (nargin == 0) |
4bf50a7d533b
fix for FTP object constructor. Allow basic operation with matlab FTP objects
David Bateman <dbateman@free.fr>
parents:
9880
diff
changeset
|
27 p.host = ""; |
4bf50a7d533b
fix for FTP object constructor. Allow basic operation with matlab FTP objects
David Bateman <dbateman@free.fr>
parents:
9880
diff
changeset
|
28 p.username = username; |
4bf50a7d533b
fix for FTP object constructor. Allow basic operation with matlab FTP objects
David Bateman <dbateman@free.fr>
parents:
9880
diff
changeset
|
29 p.password = password; |
4bf50a7d533b
fix for FTP object constructor. Allow basic operation with matlab FTP objects
David Bateman <dbateman@free.fr>
parents:
9880
diff
changeset
|
30 p.curlhandle = tmpnam ("ftp-"); |
4bf50a7d533b
fix for FTP object constructor. Allow basic operation with matlab FTP objects
David Bateman <dbateman@free.fr>
parents:
9880
diff
changeset
|
31 obj = class (p, "ftp"); |
4bf50a7d533b
fix for FTP object constructor. Allow basic operation with matlab FTP objects
David Bateman <dbateman@free.fr>
parents:
9880
diff
changeset
|
32 elseif (nargin == 1 && strcmp (class (host), "ftp")) |
4bf50a7d533b
fix for FTP object constructor. Allow basic operation with matlab FTP objects
David Bateman <dbateman@free.fr>
parents:
9880
diff
changeset
|
33 obj = host; |
4bf50a7d533b
fix for FTP object constructor. Allow basic operation with matlab FTP objects
David Bateman <dbateman@free.fr>
parents:
9880
diff
changeset
|
34 else |
4bf50a7d533b
fix for FTP object constructor. Allow basic operation with matlab FTP objects
David Bateman <dbateman@free.fr>
parents:
9880
diff
changeset
|
35 p.host = host; |
4bf50a7d533b
fix for FTP object constructor. Allow basic operation with matlab FTP objects
David Bateman <dbateman@free.fr>
parents:
9880
diff
changeset
|
36 p.username = username; |
4bf50a7d533b
fix for FTP object constructor. Allow basic operation with matlab FTP objects
David Bateman <dbateman@free.fr>
parents:
9880
diff
changeset
|
37 p.password = password; |
4bf50a7d533b
fix for FTP object constructor. Allow basic operation with matlab FTP objects
David Bateman <dbateman@free.fr>
parents:
9880
diff
changeset
|
38 p.curlhandle = tmpnam ("ftp-"); |
4bf50a7d533b
fix for FTP object constructor. Allow basic operation with matlab FTP objects
David Bateman <dbateman@free.fr>
parents:
9880
diff
changeset
|
39 __ftp__ (p.curlhandle, host, username, password); |
4bf50a7d533b
fix for FTP object constructor. Allow basic operation with matlab FTP objects
David Bateman <dbateman@free.fr>
parents:
9880
diff
changeset
|
40 obj = class (p, "ftp"); |
4bf50a7d533b
fix for FTP object constructor. Allow basic operation with matlab FTP objects
David Bateman <dbateman@free.fr>
parents:
9880
diff
changeset
|
41 endif |
9880 | 42 endfunction |