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:
$ftp->useagent('FTCh');
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:
ftp://user:password@host.com/path/to/file ftp://user:password@host.com//absolute/path/to/file
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);
$ftp->waitreply(BOOLEAN);
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.
$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.
$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.
$ftp->rename(NEWNAME [, PATH, HOST, USER, PASS, FIRE, SOCKS]); $ftp->renameURL(NEWNAME [, URL, FIRE, SOCKS]);
Renames file NEWNAME to value in PATH or URL.
$ftp->remove([PATH, HOST, USER, PASS, FIRE, SOCKS]); $ftp->removeURL([URL, FIRE, SOCKS]);
Removes file/directory specified in PATH or URL.
$ftp->mkdir([PATH, HOST, USER, PASS, FIRE, SOCKS]); $ftp->mkdirURL([URL, FIRE, SOCKS]);
Make directory specified in PATH or URL.
$ftp->sendcommand([PATH, HOST, USER, PASS, FIRE, SOCKS]); $ftp->sendcommandURL([URL, FIRE, SOCKS]);
Send raw FTP command.
$ftp->index([PATH, HOST, USER, PASS, FIRE, SOCKS]); $ftp->indexURL([URL, FIRE, SOCKS]);
Display index listing. SITE INDEX command must be implemented on host.
$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.
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.
$ftp->macsearch(FILENAME);
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]);
Basic cleanup. Requires MacPerl 5.1.4r4 or better now.
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::Anarchie class is no longer aliased to simply Anarchie.
Mac::Apps::Anarchie
Anarchie
Added waitreply method. Fixed error catching. Erorrs still are not descriptive, but now they are reported. :-)
waitreply
Get app launching from Mac::Apps::Launch, fixed descriptor disposing.
Whoops, fixed something I broke in the AEPutParamDesc stuff.
Finally got around to cleaning it up. Only minor changes.
First 'public' beta.
Still having problems with the substring/pattern/regex option on "find". I am not sure what the problem is.
http://www.stairways.com/anarchie/index.html
Chris Nandor <pudge@pobox.com> 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:
You forgot a '=back' before '=head2'
'=item' outside of any '=over'
To install Mac::Apps::Anarchie, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mac::Apps::Anarchie
CPAN shell
perl -MCPAN -e shell install Mac::Apps::Anarchie
For more information on module installation, please visit the detailed CPAN module installation guide.