Platform-independent Relative-pathname Specifier

Date:    Thu, 26 Oct 1995 23:35:54 EDT
From:    John Dowdell <71333.42@compuserve.com>
Subject: Re: @ Symbol for path
Jeff McLoughlin writes on Oct 25, in part, "What's the deal with @? I can't seem to get my external app to launch without hardcoding the path in. This gives me a problem with the eventual playback from CD. From tips and tricks I thought the @ symbol would give me the current directory and I could work down a directory from there. Any ideas?"

This platform-independent relative-pathname specifier is described on pp 53-4 of the "Tips & Tricks" manual in the section, "Using relative pathnames in Lingo." The "@" symbol is not understood by the system itself, only by Lingo -- can only be used for things internal to Director, such as branchings. Following is the entry from the Knowledge Base.

(Note that you will likely have other problems if running other applications from a project distributed on CD. That final goal may bear reevaluation... your call.)


(Q) The "Tips & Tricks" manual says that the "@" symbol can be used to indicate a platform-independent pathname. Why does it not work with the FileIO XObject?

(A) The "@" symbol does allow for a platform-independent pathname within the Director application itself. It indicates that the path to follow should have its colons or backslashes converted for the machine that it finds itself on at runtime.

FileIO uses a different set of core routines, however. They can be seen by checking the source code to the FileIO XObject, which is included as an option when installing Director for Windows. This is why that "@" convention does not work -- it uses a different set of file name processes than does the application itself. In practice, a way to duplicate this functionality within your FileIO scripting is to have a handler such as the following:

   on MachinePath
      if the machineType = 256 then return "\"
      else return ":"
   end MachinePath
It can be called by something like the following:
   set myFile = fileIO(mNew, "read", the pathName & "source" &
MachinePath() & "log.txt")
The property "itemDelimiter" can also be used along these lines. Note that the Lingo "searchPath" property, the "open" command and other functions that go outside of Director share the FileIO requirement for a platform-specific path. The "@" sign should be reserved for branching between movies or explicit dynamic linking of media.