• 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: HFS paths (was Tell Blocks Considered Harmful)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HFS paths (was Tell Blocks Considered Harmful)


  • Subject: Re: HFS paths (was Tell Blocks Considered Harmful)
  • From: KOENIG Yvan <email@hidden>
  • Date: Sun, 21 Dec 2008 13:15:05 +0100


Le 21 déc. 2008 à 03:19, Axel Luttgens a écrit :

Le 20 déc. 08 à 19:34, KOENIG Yvan a écrit :

Le 20 déc. 2008 à 19:11, Axel Luttgens a écrit :

OK, but then why do I get this one:

	(POSIX file "/Volumes/Data") as text
	--> "Data"

So, let's have a small recap:

(POSIX file "/System") as text
--> "BootDisk:System"
(POSIX file "/System1") as text -- A non existing item (file or folder)
--> "BootDisk:System1"
(POSIX file "/Volumes/Data") as text
--> "Data"
(POSIX file "/") as text
--> "BootDisk:"


Clearly, the boot disk appears as an exception wrt file -> string coercion in AppleScript: differing conventions are applied according to the target. This is perhaps a very desirable behavior, but unless clearly justified and stated in the language definition, it tends to appear at least slightly inconsistent.


I don't see any exception.

If the passed Unix path ends with a slash, we get an HFS path ending with a colon.

If the passed Unix path doesn't end with a slash, we get an HFS path without an ending colon.

It seems to be coherent.

Hello Yvan,

Yes, your approach is rather appealing, in the sense that it seems to bring some order in the behavior described above; and it is no impossible that the implementation of the file reference to text coercion in part relies upon such a reasoning.

Now, saying that this path
/
and that path
/path/to/some/item/
both end with a slash is syntactically correct, but semantically misleading.


Indeed, in a path such as
/path/to/some/item
the first slash represents the (current) root directory, and the subsequent slashes are path separators.


Put in other words, THE slash and the other slashes really are to be distinguished.
In fact, things would have appeared more clearly if a special symbol had been defined for the root directory, for example "^". Above paths would then have been written
^
^path/to/some/item/
and no one wouldn't be tempted anymore to say that they end with the same symbol.


In the hope I managed to be comprehensible,
Axel

I'm not a pro so I may be wrong but I don't understand why the first slash would can't have the behaviour of the late one when it is the unique slash available.


Remember the Holy Books: "Les premiers seront les derniers".

When it is the unique slash, the one IS the current root directory AND a path separator.

I didn't study Saussure's works but at don't see here a semantic oddity.

Yvan KOENIG _______________________________________________
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: HFS paths (was Tell Blocks Considered Harmful)
      • From: Axel Luttgens <email@hidden>
    • Re: HFS paths (was Tell Blocks Considered Harmful)
      • From: "Mark J. Reed" <email@hidden>
References: 
 >Re: Tell Blocks Considered Harmful (was Re: open for access) (From: Richard Rönnbäck <email@hidden>)
 >Re: Tell Blocks Considered Harmful (was Re: open for access) (From: Axel Luttgens <email@hidden>)
 >Re: HFS paths (was Tell Blocks Considered Harmful) (From: Chris Page <email@hidden>)
 >Re: HFS paths (was Tell Blocks Considered Harmful) (From: Axel Luttgens <email@hidden>)
 >Re: HFS paths (was Tell Blocks Considered Harmful) (From: KOENIG Yvan <email@hidden>)
 >Re: HFS paths (was Tell Blocks Considered Harmful) (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: Standard Additions documentation
  • Next by Date: Re: ?run script? best practices (was Application Script Menus)
  • Previous by thread: Re: HFS paths (was Tell Blocks Considered Harmful)
  • Next by thread: Re: HFS paths (was Tell Blocks Considered Harmful)
  • Index(es):
    • Date
    • Thread