• 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: Stuff 7/9
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stuff 7/9


  • Subject: Re: Stuff 7/9
  • From: Matt Deatherage <email@hidden>
  • Date: Wed, 7 Sep 2005 21:09:54 -0500

On 9/7/05 at 5:17 PM, Barry Wainwright <email@hidden> wrote:

> This has got to be a bug...
>
> POSIX path of "HD:Users:BNW:stuff 7/9"
>   --  "/HD/Users/BNW/stuff 7:9"

In fact, this is very much not a bug, though I cannot point you to a reference that describes why.

Informally:  If a pathname starts with a "/", it is presumed to be a POSIX path inside the file system level of Mac OS X.  This is a problem on HFS-family file systems, because any of the directories could have "/" as part of the directory or file name.  You could name your user folder "and/or" if you really wanted to annoy both the OS and grammarians.

Therefore, when constructing a POSIX path on a HFS-family disk, the system changes "/" to ":", because ":" is the one character that *can't* be in an HFS-family name.  When the system is passed a file name that has a colon in it, it knows that it's really supposed to be a slash.

It works the other way around on UFS disks - if you have a file named "10:00PM" in your user folder on a UFS startup disk, AppleScript (and the underlying Mac OS) return its HFS-style path as "HD:Users:BNW:10/00PM".

In short, if you request a full pathname that can't be legally constructed in the style you want because that style's separator character is in one of the path components, Mac OS X replaces that character in the pathname with the other separator character.  Colons change to slashes in POSIX paths, and slashes change to colons in HFS-style paths.

It is documented *somewhere*, but I don't know where.

--
Matt Deatherage                              <email@hidden>
GCSF, Incorporated                      <http://www.macjournals.com>

Fortunately, I'm a big fan of eggplant.


 _______________________________________________
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

  • Follow-Ups:
    • Re: Stuff 7/9
      • From: Emmanuel <email@hidden>
References: 
 >Stuff 7/9 (From: Barry Wainwright <email@hidden>)

  • Prev by Date: Re: NSInternalScriptError
  • Next by Date: Re: Missing values and Script Editor request
  • Previous by thread: Stuff 7/9
  • Next by thread: Re: Stuff 7/9
  • Index(es):
    • Date
    • Thread