Skip to content

Latest commit

 

History

History
61 lines (47 loc) · 1.78 KB

File metadata and controls

61 lines (47 loc) · 1.78 KB

ConvertPosix2HSFPath

Description

MacIntosh only!

Converts Posix (using '/' as delimiter) file path to HSF (using ':' as delimiter) file path.

FUNCTION ConvertPosix2HSFPath(
				PosixPath      : DYNARRAY[] of CHAR;
				VAR outHSFPath : DYNARRAY[] of CHAR): BOOLEAN;
def vs.ConvertPosix2HSFPath(PosixPath):
    return (BOOLEAN, outHSFPath)

Parameters

Name Type Description
PosixPath DYNARRAY[] of CHAR The Posix path that is to be converted.
outHSFPath DYNARRAY[] of CHAR Output parameter. Returns the converted path. If the function does not succeed the returned value is the passed 'PosixPath' value.

Remarks

_c_ (2016.06.16): This doesn't fail easily (I never could see a failure) but will return gibberish upon anything but a qualified Posix path. Interestingly, passing a qualified HSF path (needing thus no conversion!) will also return gibberish:

Example: path2convert := /Users/user/Desktop/New File.txt ConvertPosix2HSFPath(path2convert, path) --> /Users/user/Desktop/New File.txt > Macintosh HD:Users:user:Desktop:New File.txt --> OK

path2convert := Macintosh HD:Users:user:Desktop:New File.txt { <-- this needs no conversion! } ConvertPosix2HSFPath(path2convert, path) --> Macintosh HD:Users:user:Desktop:New File.txt > :Macintosh HD/Users/user/Desktop/New File.txt --> GIBBERISH

Examples

resultOK := ConvertPosix2HSFPath(PosixPath, outHSFPath);
import vs

# MacIntosh only!.
PosixPath = 'C:/Temp'

ok, outHSFPath = vs.ConvertPosix2HSFPath(PosixPath)
vs.Message('ConvertPosix2HSFPath returned: ' + str((ok, outHSFPath)))

See Also

VS Functions: ConvertHSF2PosixPath

Version

Availability: from Vectorworks 2010

Category