Re: Disk Properties
Re: Disk Properties
- Subject: Re: Disk Properties
- From: Ron Hunsinger <email@hidden>
- Date: Tue, 24 Jul 2012 17:02:47 -0700
On Jul 24, 2012, at 1:53 PM, Luther Fuller wrote: Thanks, but in this case I needed to test for writability = not a readonly image disk, not for permissions.
Ask Disk Utility (or more specifically, its command-line tool diskutil):
on isReadOnly(aDiskAlias) set myDisk to quoted form of POSIX path of aDiskAlias
set cmd to "/usr/sbin/diskutil info " & myDisk & " | echo $(/usr/bin/sed -n 's/Read-Only Volume://p') " return do shell script cmd end isReadOnly
This returns "YES" or "NO" depending on whether the volume itself is Read-Only, irrespective of any permissions.
Alternatively, you could search for "Protocol:" instead of "Read-Only Volume:". Protocol will have values like "SATA", "FireWire", or "Disk Image".
-Ron Hunsinger |
_______________________________________________
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