• 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: Disk Properties
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Disk Properties (From: Luther Fuller <email@hidden>)
 >Re: Disk Properties (From: "koenig.yvan" <email@hidden>)
 >Re: Disk Properties (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: Disk Properties
  • Next by Date: [ANN]Reading uncompiled scripts from ASE in Mountain Lion
  • Previous by thread: Re: Disk Properties
  • Next by thread: Re: Disk Properties
  • Index(es):
    • Date
    • Thread