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

Re: Volume status


  • Subject: Re: Volume status
  • From: Mr Tea <email@hidden>
  • Date: Fri, 01 Oct 2004 16:39:47 +0100

This from Jakub Formanek - dated 1/10/04 11ยท12 am:

> How can I get info about mounted volume/disk is writable or read-only?

As an alternative to my previous suggestion, you could always try a more
direct approach to test if a volume/disk can be written to:

--=======================================
    tell application "Finder"
     activate
     choose folder with prompt "Select a volume
     to check:" default location ":Volumes:" as alias returning dsk
    end tell

    set filePath to "" & dsk & "test.txt"
    set psxPath to quoted form of POSIX path of filePath


    try
     set f to open for access file filePath with write permission
     close access f
     do shell script "rm " & psxPath
     tell application "Finder" to display dialog "Can write to this disk"
    on error
     try
      close access f
     end try
     tell application "Finder" to display dialog "Can't write to this disk"
    end try
--=======================================

HTH,


Nick
pp Mr Tea

--


 _______________________________________________
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: 
 >Volume status (From: Jakub Formanek <email@hidden>)

  • Prev by Date: Re: Get Name of Current Script?
  • Next by Date: Re: Variable Ponderance
  • Previous by thread: Re: Volume status
  • Next by thread: Re: Volume status
  • Index(es):
    • Date
    • Thread