revUnixFromMacPath | ||||||||||
Type | function | |||||||||
Dictionary | LCS | |||||||||
Library | LiveCode Script | |||||||||
Syntax |
| |||||||||
Summary | ||||||||||
Introduced | 1.0 | |||||||||
Changes | 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. | |||||||||
OS | mac, windows, linux | |||||||||
Platforms | desktop, server | |||||||||
Parameters |
| |||||||||
Example |
| |||||||||
Values |
| |||||||||
Related | Keyword: string Control Structure: function Message: startup, openBackground, preOpenStack, openStack, preOpenCard Command: answer file Library: Common library, library Glossary: application, standalone application, file path, main stack, OS X, relative file path, group, absolute file path, Mac OS, message, Unix, delimiter, handler | |||||||||
Description | Use the revUnixFromMacPath function to convert a Mac OS-style file path to the LiveCode file path format (for example, to convert a pathname returned by an XFCN). The revUnixFromMacPath function converts colons (:) to slashes (/), the folder-level delimiter for Unix pathnames. It also adjusts relative paths and absolute file path|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 LiveCode, 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. LiveCode 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 LiveCode commands and functions, you do not need to convert the pathname, since LiveCode does it for you.
| |||||||||
Tags | file system |