• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: curl ... file listings...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: curl ... file listings...


  • Subject: Re: curl ... file listings...
  • From: "Mark J. Reed" <email@hidden>
  • Date: Tue, 25 Oct 2005 10:29:42 -0400

On 10/24/05, Doug McNutt <email@hidden> wrote:
You might well find a perl module for the purpose. Perl can call curl fairly easily. using backquotes.

That would just be silly.  Perl's Net::FTP module lets you interact with an FTP server directly, without calling the shell to call curl to open up a new FTP control connection for every command you decide to issue.   

my $conn = Net::FTP->new('ftp.somewhere.net');
$conn->login;
$conn->cd("/some/remote/directory");
my @lines = $conn->ls; # short listing
my @long = $conn->dir; # long listing

The actual output is still up to the remote server to format, unfortunately.  

curl is a great tool for downloading stuff, but if you need to do more than just fetch a known file (or set of files by following HTML links), it's probably not the best thing for the job.  For full FTP browsing around, you're better off using something like Net::FTP, or Fetch (is Fetch AppleScriptable?) , or scripting the regular old ftp command with something like expect.




--
Mark J. Reed <email@hidden>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: curl ... file listings...
      • From: Emmanuel <email@hidden>
  • Prev by Date: display dialog with icon bug
  • Next by Date: Re: display dialog with icon bug
  • Previous by thread: Re: curl ... file listings...
  • Next by thread: Re: curl ... file listings...
  • Index(es):
    • Date
    • Thread