Re: hdiutil problem
Re: hdiutil problem
- Subject: Re: hdiutil problem
- From: Axel Luttgens <email@hidden>
- Date: Sun, 18 May 2008 11:14:32 +0200
On 15 mai 08, at 01:34, Luther Fuller wrote:
This script hangs at the last line in Leopard (it worked OK in
Tiger) ...
set imageAlias to alias "Work_Files:Backup - 14 May 2008.sparseimage"
set imagePath to quoted form of (POSIX path of imageAlias)
set response to (do shell script "hdiutil burn " & imagePath & " -
sizequery")
Activity Monitor indicates that hdiutil is running and taking 100%
CPU and never finishing.
So, I go to Terminal and do this with no problem ...
Last login: Wed May 14 17:55:04 on ttys000
luther-fullers-mac-mini:~ lutherfuller$ hdiutil burn /Volumes/
Work_Files/Backup\ -\ 14\ May\ 2008.sparseimage -sizequery
0x00000000008C1000 (9179136) sectors in image, 0x00000000008C1020
(9179168) sectors needed for burn
Activity Monitor indicates that hdiutil and bash are still running,
but I did get a valid response.
So, there is still a problem, even in Terminal...
Who knows what is happening here?
Strangely, when run in Terminal,
hdiutil burn <image> -sizequery
waits for an INT signal (i.e. for the user to type ^C).
The same happens when the above is run from "do shell script"; this
would just be a (rather big) inconvenience, as there are ways to send
the expected signal, wouldn't there be another phenomenon: hdiutil
seems to forget to write to stdout...
More generally, hdiutil seems to incorrectly handle I/O; just try this
in Terminal:
hdiutil burn <image> -sizequery &>/tmp/XYZ
and type ^C after a while. File /tmp/XYZ gets created, but desperately
remains empty.
Looks like some bug is at work somewhere... ;-)
Bug for bug, I found another one: the -debug option restores I/O
capability, as expected spits out a lot of info, and very courteously
throws an error that halts the command's execution (thus alleviating
the need to send an INT).
As a result, there is a workaround:
do shell script "hdiutil burn " & imagePath & " -sizequery -debug |
egrep 'sectors (in image|needed for burn)'; echo"
(the echo command is just there to quickly avoid a non-zero return code)
I haven't yet had the opportunity to check with Tiger; is hdiutil's
behavior more consistent there? If yes, filing a bug report could be a
good idea.
HTH,
Axel
_______________________________________________
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