• 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: Using "original item" property on aliases from a network share
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using "original item" property on aliases from a network share


  • Subject: Re: Using "original item" property on aliases from a network share
  • From: Emmanuel LEVY <email@hidden>
  • Date: Wed, 24 Jun 2009 19:17:00 +0200


On Jun 24, 2009, at 6:16 PM, Axel wrote:

Hello

I wrote a script which give the path of the file pointed by the alias given as an argument. It works without problem on local disks. It doesn't work on mounted network shares (AFP). The exception "File wasn't found" (-43) is thrown.

Is that the expected behaviour ? Is there a way to resolve an alias on a network volume ?

The alias type is not well suited to work with AFP (nor any other) mounts.


The reason is very simple and has bitten several already: if you mount a disk "myHD", then it's known as alias "myHD:", which carries unsufficient information: that descriptor can describe your own hard disk (if it's so named), or an AFP mount, or a shared folder. Furthermore, if you mount several volumes with the same name, alias "myHD:" may be any of them.

The full information is only available if you work with posix paths: you own hard disk will be "/", an AFP mount will be "/Volumes/myHD/", and a shared folder will be "/Network/myHD/". Furthermore, several volumes with the same name get different posix paths, namely: "/ Volumes/myHD/", "/Volumes/myHD-1/", "/Volumes/myHD-2/" etc.

The only way I know to work with the volume's name of an AFP mount is the following strategy: search /Volumes/ (use do shell script "ls / Volumes") for myHD, myHD-1, myHD-2 etc until you find your volume. If you have several volumes with the same name the only way to figure out which is which is to check for a known file.

Emmanuel
_______________________________________________
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
  • Follow-Ups:
    • Re: Using "original item" property on aliases from a network share
      • From: Axel <email@hidden>
References: 
 >Using "original item" property on aliases from a network share (From: Axel <email@hidden>)

  • Prev by Date: Re: launch an application, and on quit, logout?
  • Next by Date: list issues
  • Previous by thread: Re: Using "original item" property on aliases from a network share
  • Next by thread: Re: Using "original item" property on aliases from a network share
  • Index(es):
    • Date
    • Thread