cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Write-out to file?

From: Bill Mercer <BMercer_at_nccer.org>
Date: Thu, 20 May 2010 14:29:52 -0400

I've used curl with FileMaker several times, it's a great way to extend
Fm's functionality.

It's possible to read the error number that curl returns and make
decisions based on that, but
what I prefer to do is create a set of batch files to execute the
common curl tasks, and use the
then call those batch files from within FileMaker. The advantage of
this is that you can use the batch
file to check for the existence of a file before even calling curl. You
also have the ability to generate
your own return codes, and make them sensible for your specific
purpose.

Windows batch files also support looping, branching, and testing
various attributes of files.
So the batch file can check to see if the file exists, and if it
doesnt, the batch file can return an error
code you control. I believe that will be a lot easier than trying to
parse output text.

-- 
Cheers, 
Bill Mercer - National Center for Construction Education and Research 
bmercer_at_nccer.org 
3600 NW 43rd St Bldg G ● Gainesville, Florida  ● 32606
Phone 352-334-0911 ● Fax 352-334-0932
http://www.nccer.org
>>> On 5/20/2010 at 7:34 AM, in message
<4318f28f31eb0c139a2b75b33de5fc5b_at_mail.gmail.com>, Alec Gregory
<alecg_at_plutobooks.com> wrote:
> Hullo cURL users,
> 
> 
> 
> I’m utterly new, but already really impressed by the functionality
and ease
> of use of cURL. I am currently using it in conjunction with a
Filemaker Pro
> database to send (and get) files via ftp and http. That is, I run a
> Filemaker script that sends a cURL command to the windows command
line. What
> I do want Filemaker to be able to do, though, is work out whether a
certain
> process (say, uploading a file to an ftp) has been successful. I’m
not
> expecting cURL to fail, but it’s perfectly possible, for example,
for
> someone to tell cURL to upload a file that doesn’t exist. So
really, I want
> cURL to create a txt file giving write-out details. Filemaker could
then
> import this file and work out if the transfer went down OK. I
optimistically
> tried using –o after my –w but unsurprisingly that didn’t
create a file with
> the write out in. Is there any other way to do it?
> 
> 
> 
> Thanks,
> 
> 
> 
> Alec
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-05-20