/Volumes/SomePlace-1 <----Why?

Jim Ault JimAultWins at yahoo.com
Wed Feb 7 12:16:08 EST 2007


On 2/7/07 9:10 AM, "Roger.E.Eller at sealedair.com"
<Roger.E.Eller at sealedair.com> wrote:

> We have run into a scripting issue when a volume has been ejected or
> unmounted, then re-mounted in Mac OS X. The re-mounted volume name path
> will have a -1 or -2, etc. appended to the end of path. This is
> problematic for scripting to automatically access files within the volume
> (using the previously known path). Only in Terminal can you see that the
> path is being altered by the OS. In the Finder, the user still sees the
> correct volume name without the appended numbers.
> 
> How can I remove these entries from /Volumes (other than reboot) so that
> re-mounting the drive/location renders the same path as when first
> mounted? Thanks in advance!
I don't know the specific answer to your question about removing entries,
but you could use a 'try' loop

on test
  
  put empty into tryCount
  put empty into suffix
  repeat until tryCount > 200
    if tryCount is not empty then put ("-"&tryCount) into suffix
    try
      -->use (volumeName& suffix)
      put empty into exitFlag
    catch whichErr
      add 1 to tryCount
      put "oops" into exitFlag
    end try
    if exitFlag is empty then exit repeat
  end repeat
  
end test

Jim Ault
Las Vegas





More information about the use-livecode mailing list