• 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: tutorial on HFS versus finder and POSIX file path ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tutorial on HFS versus finder and POSIX file path ?


  • Subject: Re: tutorial on HFS versus finder and POSIX file path ?
  • From: Yvon Thoraval <email@hidden>
  • Date: Tue, 17 Oct 2006 18:02:15 +0200


Le 17 oct. 06 à 17:45, Mark J. Reed a écrit :


What is the difference between what you're calling "Finder" and "HFS"?

As far as I know, there are only two styles of pathname.  Unless by

"Finder" you're referring to the AppleScript syntax (file of folder of

disk, etc.). 


yes exacrly a bit too verbose for me )))

This AS snippet:


tell application "Finder"

   display dialog (folder "mreed" of folder "Users" of disk

"Greyskull") as string

end tell


will give you the traditional Mac OS pathname notation:


Greyskull:Users:mreed


(where "Greyskull" is the name of my boot disk, formerly "Macintosh HD")


The POSIX-style equivalent is just /Users/mreed, because Greyskull is

the root volume:


display dialog (POSIX file "/Users/mreed")


in fact, if I type the above into Script Editor, it magically

redecompiles to this:


display dialog (file "Greyskull:Users:mreed")


yes i know but, to me, it's an annoying feature ...

The translation rules are simple:


Mac OS:  absolute paths start with the volume name; the separator is a

colon.  A pathname starting with a colon is relative, but it's hard to

say to what, since there's no well-defined concept of a "working

folder" in traditional Mac OS.


POSIX: absolute paths start with a /, which is also the separator.

The boot volume is /, any other mounted volumes are /Volumes/volname/.

Relative paths start with a name with no leading /.


A file that shows up in the Finder as "foo/bar" will show up in the

shell as "foo:bar".


yes a know all of that but in some circonstance i get an error message like can't make fref from POSIX blahblah...

i've catched only recently the diferent forms POSIX path to and POSIX file... which do more or less the reverse.

the prob also is in that english isn't my mother tongue, then syntactically speaking, is harder to understand the way AS puts the words together.

best,

Yvon

 _______________________________________________
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: tutorial on HFS versus finder and POSIX file path ?
      • From: Matt Deatherage <email@hidden>
    • Re: tutorial on HFS versus finder and POSIX file path ?
      • From: Doug McNutt <email@hidden>
References: 
 >tutorial on HFS versus finder and POSIX file path ? (From: Yvon Thoraval <email@hidden>)
 >Re: tutorial on HFS versus finder and POSIX file path ? (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: tutorial on HFS versus finder and POSIX file path ?
  • Next by Date: Re: tutorial on HFS versus finder and POSIX file path ?
  • Previous by thread: Re: tutorial on HFS versus finder and POSIX file path ?
  • Next by thread: Re: tutorial on HFS versus finder and POSIX file path ?
  • Index(es):
    • Date
    • Thread