- SEE ALSO
Mac::Apps::Anarchie - Interface to Anarchie 2.01+
use Mac::Apps::Anarchie; $ftp = new Mac::Apps::Anarchie; #see description for the rest
This is a MacPerl interface to the popular MacOS shareware FTP/archie client, Anarchie. For more info, see the Anarchie documentation.
Also required is the Mac::Apps::Launch module, which requires MacPerl 5.1.4r4.
NOTE: for some explanations of methods, drop Anarchie on Script Editor, and check the Anarchie docs.
Before using, you must autosplit the module. See version notes for 1.4 below.
$ftp->open(ALIAS); $ftp->quit; $ftp->showabout; $ftp->close; $ftp->closeall; $ftp->undo; $ftp->cut; $ftp->copyclip; $ftp->paste; $ftp->clear; $ftp->selectall;
NOTE: * denotes compatability with Fetch. Fetch does not use the variables SOCKS, FIRE, BINARY, or TYPE. Fetch implements some of these methods differently than Anarchie. To use Fetch instead of Anarchie for these methods, call the method:
There are two forms of each of the following methods: "method" and "methodURL". The methodURL version takes the user name, password, host and path in the URL instead of separately. URLs are usually in the form:
See Anarchie docs for more info on URLs.
Also, the host, username, password, proxy firewall and socks firewall can be preset and then omitted during the method call. This saves a lot of code writing if you are going to make multiple calls to the same host. If a method explicitly names any of those strings, it overrides presets. If username and password are not specified anywhere, FTP is done anonymously.
$ftp->host(HOST); $ftp->user(USER); $ftp->pass(PASS); $ftp->fire(FIRE); $ftp->socks(SOCKS);
If you don't want MacPerl to wait for Anarchie to finish what it is doing, then call this with the value 0. You can change it back to 1 if you do want it to wait. The initial setting is 1.
- fetch *
$ftp->fetch(FILENAME [, PATH, BINARY, TYPE, HOST, USER, PASS, FIRE, SOCKS]); $ftp->fetchURL(FILENAME [, URL, BINARY, TYPE, FIRE, SOCKS]);
Fetches file and saves to FILENAME on local drive. BINARY is boolean for whether file is binary or ascii. TYPE is the creator code to link file to. NOTE: for Fetch, FILENAME must be an existing directory name, NOT a filename. For Anarchie, FILENAME must be a file if the fetched item is a file or a directory if the fetched item is a directory. Anarchie will create FILENAME on the local drive if it does not exist.
- store *
$ftp->store(FILENAME [, PATH, BINARY, HOST, USER, PASS, FIRE, SOCKS]); $ftp->storeURL(FILENAME [, URL, BINARY, FIRE, SOCKS]);
Stores file FIELNAME from local drive to remote location specified.
- rename *
$ftp->rename(NEWNAME [, PATH, HOST, USER, PASS, FIRE, SOCKS]); $ftp->renameURL(NEWNAME [, URL, FIRE, SOCKS]);
Renames file NEWNAME to value in PATH or URL.
- remove *
$ftp->remove([PATH, HOST, USER, PASS, FIRE, SOCKS]); $ftp->removeURL([URL, FIRE, SOCKS]);
Removes file/directory specified in PATH or URL.
- mkdir *
$ftp->mkdir([PATH, HOST, USER, PASS, FIRE, SOCKS]); $ftp->mkdirURL([URL, FIRE, SOCKS]);
Make directory specified in PATH or URL.
- sendcommand *
$ftp->sendcommand([PATH, HOST, USER, PASS, FIRE, SOCKS]); $ftp->sendcommandURL([URL, FIRE, SOCKS]);
Send raw FTP command.
- index *
$ftp->index([PATH, HOST, USER, PASS, FIRE, SOCKS]); $ftp->indexURL([URL, FIRE, SOCKS]);
Display index listing. SITE INDEX command must be implemented on host.
- list *
$ftp->list(FILENAME, [PATH, HOST, USER, PASS, FIRE, SOCKS]); $ftp->listURL(FILENAME, [URL, FIRE, SOCKS]);
List files in a directory, put into file FILENAME. Fetch apparently only lists to the screen, while Anarchie lists to a file. For Fetch, just put any old text in place of FILENAME and it should work just fine.
$ftp->nlist(FILENAME, [PATH, HOST, USER, PASS, FIRE, SOCKS]); $ftp->nlistURL(FILENAME, [URL, FIRE, SOCKS]);
List names of files in a directory, put into file FILENAME.
Anarchie Suite, Part Deux
NOTE: These methods are NOT supported at all by Fetch.
$ftp->find(FILENAME [, SERVER, MAX, CASE, REGEX, URL]);
Find file containing text FILENAME in Archie SERVER with maximum matches MAX. CASE is boolean (0 or 1) for case sensitive. REGEX is 0, 1 or 2 for denoting that FILENAME is a substring, pattern, or regular expression.
Find Mac file containing text FILENAME on Ambrosia's Mac server.
$ftp->showtranscript; $ftp->showarchie; $ftp->showget; $ftp->updateserverlist; $ftp->showlog; $ftp->showmacsearch; $ftp->showtips;
$ftp->geturl(URL [, FILENAME]);
- v.1.4, January 3, 1998
Basic cleanup. Requires MacPerl 5.1.4r4 or better now.
- v.1.4, November 3, 1997
Pulled out main functions as autosplit/autoload files. Before using, you must run a script such as the following, in order to AutoSplit the routines:
#!perl -w use AutoSplit; $dir = 'HD:MacPerl:site_perl'; autosplit("$dir:Mac:Apps:Anarchie.pm","$dir:auto",0,1,1);
This also means that the
Mac::Apps::Anarchieclass is no longer aliased to simply
- v.1.3, October 15, 1997
waitreplymethod. Fixed error catching. Erorrs still are not descriptive, but now they are reported. :-)
- v.1.2, October 13, 1997
Get app launching from Mac::Apps::Launch, fixed descriptor disposing.
- v.1.1 May 4, 1997
Whoops, fixed something I broke in the AEPutParamDesc stuff.
- v.1.0 May 4, 1997
Finally got around to cleaning it up. Only minor changes.
- v.0.2 March 20, 1997
First 'public' beta.
- regex find
Still having problems with the substring/pattern/regex option on "find". I am not sure what the problem is.
- Anarchie Home Page
Chris Nandor <firstname.lastname@example.org> http://pudge.net/
Copyright (c) 1998 Chris Nandor. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Please see the Perl Artistic License.
Version 1.50 (03 January 1998)
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 495:
You forgot a '=back' before '=head2'
- Around line 499:
'=item' outside of any '=over'