Error getting tags :
error 404Error getting tags :
error 404 revUnixFromMacPath | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
revUnixFromMacPath
Basics
Expander triangle
Type
Function
Syntax
revUnixFromMacPath(macPathname[,convertOSX])
Introduced
1.0
Changed
2.1.1
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Converts a Mac OS-style pathname to a Unix-style pathname.
Examples

revUnixFromMacPath("Disk:Folder:") -- returns "/Disk/Folder/"
answer file revUnixFromMacPath(someXFCN())
put revUnixFromMacPath(myValue,true)

Additional Comments
Expander triangle

Use the revUnixFromMacPath function to convert a Mac OS-style file path to the Revolution file path format (for example, to convert a pathname returned by an XFCN).

Parameters:

The macPathname is a file or folder pathname in the format used by the Mac OS for file paths.

Value:

The revUnixFromMacPath function returns a string with the file path in the format expected by the Mac OS.

The convertOSX is true or false. If you don't specify the convertOSX, if OS X is running, Revolution assumes the macPathname is an OS X-style path to a Mac OS-style path; otherwise, it assumes the macPathname is a Mac OS-style path.

Comments:

The revUnixFromMacPath function converts colons (:) to slashes (/), the folder-level delimiter for Unix pathnames. It also adjusts relative paths and absolute paths to be in Unix standard form.

On Mac OS systems, absolute paths always begin with the name of the disk that the file or folder is on. On OS X systems, the startup disk's name does not appear in absolute file paths. Instead, if a file or folder is on the startup disk, the first part of the file path is the top-level folder that the file is in. If a file or folder is on a disk other than the startup disk, its absolute path starts with "Volumes", followed by the disk name.

The OS X path convention is used by Revolution, but the old Mac OS-style path convention is used by certain applications (such as AppleScript), even on OS X systems. If the convertOSX is true (or if you don't specify the convertOSX and the application is running under OS X), the revUnixFromMacPath function assumes that absolute paths are using the OS X convention. If the convertOSX is false, the revUnixFromMacPath function assumes that absolute paths use the Mac OS convention.

Revolution always uses the Unix pathname standard for cross-platform compatibility. You need to convert the pathname only if you are passing it to another program or external. If you are using only Revolution commands and functions, you do not need to convert the pathname, since Revolution does it for you.

Note: When included in a standalone application, the Common library is implemented as a hidden group and made available when the group receives its first openBackground message. During the first part of the application's startup process, before this message is sent, the revUnixFromMacPathfunction is not yet available. This may affect attempts to use this function in startup, preOpenStack, openStack, or preOpenCardhandlers in the main stack. Once the application has finished starting up, the library is available and the revUnixFromMacPathfunction can be used in any handler.

Changes to Revolution:

The convertOSX parameter was introduced in version 2.1.1. In previous versions, the revUnixFromMacPath function did not attempt to convert between the Mac OS and OS X conventions described above.

User Comments
Expander triangle