Absolute File Paths - Bug or bad Docs

Sarah Reichelt sarah.reichelt at gmail.com
Wed Sep 24 05:27:22 EDT 2008


On Wed, Sep 24, 2008 at 3:57 PM, Kay C Lan <lan.kc.macmail at gmail.com> wrote:
> The docs, for 'absolute file path':
>
> The full name and location of a file, beginning with the disk the file is
> on, including ....
>
> The 'Tip' for defaultFolder includes the above plus points out that UNIX
> naming convention is used so the path MUST begin with and folders separated
> by "/".
>
> The example under 'defaultFolder' is:
>
> set the defaultFolder to "/Hard Disk/Applications/GetIt"
>
> All simple enough.
>
> But when I do:
>
> answer files "Select a file" with "/Mac HD/Users/kcl/stacks/" titled "Choose
> a stack"
>
> I end up in the bowels of the Rev App bundle.
>
> Even if I do the above in the message box it ends up in the Rev App bundle.
>
> BUT, if I remove the reference to the hard disc everything works fine, both
> in my stack and the msg box.
>
> This applies whether I'm looking in Users, Applications, System...
> everywhere. Referring to the HD or partition fails to lead anywhere other
> than the bowels of the Rev App Bundle
>
> So has something changed in Rev 3.0 or have the Docs been wrong all this
> time?

The docs are out of date at least as far as OS X is concerned. The
hard disk name had to be specified when using Mac OS 9 or less, but
under OS X, you have to use the Unix type file name where the hard
drive is left off.
For your example, try this:
     answer files "Select a file" with "/Users/kcl/stacks/" titled
"Choose a stack"

But, if you are using a networked or removable drive, then you have to
specify the name of the drive, prefaced with "/Volumes"
e.g. /Volumes/Backup HD/Docs

The final problem is if you need to send the path to an AppleScript
routine. AppleScript clings to the old style and would use:
   Mac HD:Users:kcl:stacks:
But you can do the conversions back & forth using the
revMacFromUnixPath and revUnixFromMacPath functions.

BTW, I don't understand how specifying the drive name gets you into
the bowels, but perhaps it just uses the initial defaultFolder since
the specified folder does not really exist.

Cheers,
Sarah



More information about the use-livecode mailing list