• 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 to get FTP directory listing?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: curl to get FTP directory listing?


  • Subject: Re: curl to get FTP directory listing?
  • From: Malcolm Fitzgerald <email@hidden>
  • Date: Thu, 20 Apr 2006 08:04:05 +1000


On 20/04/2006, at 4:25 AM, Eric Geoffroy wrote:

I can upload and download with curl, but getting a simple file listing is giving me a bad time. I'm currently scripting the Finder to check for old files on many different FTP directories. It returns modification dates then I do some math in AS and determine whether the directory has been inactive for awhile. This is slow. I thought curl might be able to do this faster.

According to the man page,

" When used on a FTP or FILE file, curl displays the file size and last modification time only.
The -X flag can be used to send another raw FTP command, but defaults to LIST.

According to the man page,

       -X/--request <command>
	      (HTTP) Specifies a custom request to use when communicating with
	      the  HTTP server.	 The specified request will be used instead of
	      the standard GET. Read the HTTP 1.1  specification  for  details
	      and explanations.

	      (FTP) Specifies a custom FTP command to use instead of LIST when
	      doing file lists with ftp.

	      If this option is used several times, the last one will be used.

You may want to look at the Q flag,

       -Q/--quote <comand>
	      (FTP) Send an arbitrary command to the  remote  FTP  server,  by
	      using  the  QUOTE command of the server. Not all servers support
	      this command, and the set of QUOTE commands are server specific!
	      Quote  commands are sent BEFORE the transfer is taking place. To
	      make commands take place after  a	 successful  transfer, prefix
	      them  with a dash '-'. You may specify any amount of commands to
	      be run before and after the  transfer.  If  the  server  returns
	      failure  for  one	 of the commands, the entire operation will be
	      aborted.

	      This option can be used multiple times.


Be aware that when you use Q the arbitrary command that you send is not the "english like commands" that FTP uses in the shell, it expects the raw codes, eg, "DELE" not "delete" ;-)


The utility of X and Q depends on your server's FTP functionality, they vary a good deal.


Malcolm

_______________________________________________
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


References: 
 >curl to get FTP directory listing? (From: Eric Geoffroy <email@hidden>)

  • Prev by Date: Re: Verify if name contains an element of a list
  • Next by Date: Re: Apply User and Groups to Items in a Folder
  • Previous by thread: Re: curl to get FTP directory listing?
  • Next by thread: [ANN] April Boston AppleScript Users Group Meeting
  • Index(es):
    • Date
    • Thread