• 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: do shell script without blocking?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do shell script without blocking?


  • Subject: Re: do shell script without blocking?
  • From: Christopher Nebel <email@hidden>
  • Date: Wed, 16 Feb 2005 21:19:15 -0800

On Feb 16, 2005, at 7:34 PM, Gnarlodious wrote:

Entity Christopher Nebel spoke thus:

"do shell script" watches the command's
stdout and stderr, and blocks until they're both closed, effectively
saying "There's no more data for you to read."

Is there a way using this construct to know when an operation is complete?
Because right now I'm using this gimmick:


repeat
try
do shell script "gzip -d < /private/tmp/" & fileName & " >>
~/Sites/Common/Data/" & domain & ".log"
exit repeat
on error
delay 5
end try
end repeat


Maybe there's a more elegant way to do it.

I don't understand what you're trying to do here. Without any redirection cleverness like we've been talking about, "do shell script" won't return until the command is done. What the above script is doing is attempting to compress a particular file; if it fails, then it waits five seconds and tries again. The only situation I can imagine this working in is if the file isn't there, but someone else will create it soon. If that's the case, then you're asking the wrong question, or at least in the wrong place; you really ought to be trying to block on the creation of the file.



--Chris Nebel AppleScript Engineering _______________________________________________ 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: 
 >Re: do shell script without blocking? (From: Gnarlodious <email@hidden>)

  • Prev by Date: Re: A 'Stop' handler for when script is run in editor?
  • Next by Date: Re: Compiling scripts that control applications that aren't installed
  • Previous by thread: Re: do shell script without blocking?
  • Next by thread: Re: do shell script without blocking?
  • Index(es):
    • Date
    • Thread