Name
MakeHostPath -- convert Hollywood path to host path format (V9.0)
Synopsis
p$ = MakeHostPath(path$)
Function
This function can be used to convert a platform-independent Hollywood path to a path in the host system's canonical path format. The path that should be converted has to be passed in path$.

To ensure cross-platform compatibility, Hollywood paths may contain several constituents that the underlying host operating system doesn't understand. For example, it is possible to use .. on AmigaOS and compatibles to indicate the parent directory even though AmigaOS doesn't understand this. It's also possible to use normal slashes in paths on Windows even though that operating system normally uses backslashes. Conversely, it's also possible to use backslashes on all other systems although they use slashes, and so on.

MakeHostPath() will make sure that the path it returns is fully compliant with the host operating system's requirements. However, you normally don't have to use this function as all Hollywood functions can deal with platform-independent Hollywood paths. It might only be necessary to call this function when passing paths to external programs which don't understand Hollywood's platform-independent path format.

Inputs
path$
path to convert
Results
p$
converted path in the host's canonical format
Example
Print(MakeHostPath("../image.jpg"))
On AmigaOS, this will print "/image.jpg" since AmigaOS doesn't understand the .. token. On Windows, this will print "..\image.jpg" since Windows uses backslashes instead of slashes. On all other platforms the source string will be returned because no changes are necessary.

Show TOC