• 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
curl questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

curl questions


  • Subject: curl questions
  • From: Jim Brandt <email@hidden>
  • Date: Tue, 17 Feb 2009 09:22:49 -0600

I have a curl question.

This is a handler I have in a script:
(_T_B_S, _log, _Date, and My_Lib are globals)

on do_cURL(_URL, PageName)
set cmd to "curl \"" & _URL & "\" -o \"" & _T_B_S & PageName & "\""
try
with timeout of 10 seconds
do shell script cmd
end timeout
on error errMsg number errNum
-->>>-1712 (Time out Error number)
if errNum = -1712 then
set _time to time string of (current date)
set _mess to _Date & " " & _time & " - "
set _mess to (_mess & "timeout error: " & errNum as text) & " \"" & errMsg & "\""
tell me to Message(_mess, _log) of My_Lib
display dialog errMsg default answer errNum
else
--handle some other error
set _time to time string of (current date)
set _mess to _Date & " " & _time & " - "
set _mess to (_mess & "curl error: " & errNum as text) & " \"" & errMsg & "\""
tell me to Message(_mess, _log) of My_Lib
set _mess to cmd
tell me to Message(_mess, _log) of My_Lib
end if
end try
end do_cURL



The script had a total of 193 files to download. It download the first 187 correctly.
On file 188, the filesize was 116K. The script (actually curl) downloaded 60K of the file and
hung. The timeout was not triggered (after waiting well over two minutes)
nor was any other error triggered. Since I was trying to debug this, I was running it
from the script editor. I could not stop the script. I had to do a force quit.


When I tried to trash the partially downloaded file, it would not delete (Finder said
it was still "in use").


My questions:

    1) When a shell command runs, "who" is the task owner?
         Is it the kernal_task under user "root"?

     2) How do I trap this type of error? It's already in a try block.
          What other choices do I have?

TIA,

Jim

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: curl questions
      • From: Skeeve <email@hidden>
    • Re: curl questions
      • From: Doug McNutt <email@hidden>
    • Re: curl questions
      • From: Emmanuel Levy <email@hidden>
  • Prev by Date: Re: AppleScript for Mobile
  • Next by Date: Re: curl questions
  • Previous by thread: Re: AppleScript for Mobile
  • Next by thread: Re: curl questions
  • Index(es):
    • Date
    • Thread