VS:ConvertHSF2PosixPath: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
m (Transfer Orso to _c_) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<desc> | <desc> | ||
MacIntosh only! | |||
Converts HSF (using ':' as delimiter) file path to Posix (using '/' as delimiter) file path.</desc> | Converts HSF (using ':' as delimiter) file path to Posix (using '/' as delimiter) file path.</desc> | ||
Line 31: | Line 31: | ||
outPosixPath | outPosixPath | ||
DYNARRAY[] of CHAR | DYNARRAY[] of CHAR | ||
Output parameter. Returns the converted path. If the | Output parameter. Returns the converted path. If the function does not succeed the returned value is the passed 'HSFPath' value. | ||
</line> | </line> | ||
</lineList> | </lineList> | ||
Line 39: | Line 39: | ||
<return> | <return> | ||
Returns true if the conversion succeeds. False if it fails.<BR> | Returns true if the conversion succeeds. False if it fails.<BR> | ||
The resulted Posix path will be the same as the passed HSF path if the | The resulted Posix path will be the same as the passed HSF path if the function fails.</return> | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<remark></remark> | <remark> | ||
[[User:CBM-c-|_c_]] (2016.06.16): This doesn't fail easily (I never could see a failure) but will return gibberish upon anything but a qualified HSF path. Interestingly, passing a qualified posix path (needing thus no conversion!) will also return gibberish: | |||
Example: | |||
path2convert := Macintosh HD:Users:user:Desktop:New File.txt | |||
ConvertHSF2PosixPath(path2convert, path) | |||
--> Macintosh HD:Users:user:Desktop:New File.txt > /Users/user/Desktop/New File.txt | |||
--> OK | |||
path2convert := /Users/user/Desktop/New File.txt { <-- this needs no conversion! } | |||
ConvertHSF2PosixPath(path2convert, path) | |||
--> /Users/user/Desktop/New File.txt > /:Users:user:Desktop:New File.txt | |||
--> GIBBERISH | |||
</remark> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
Latest revision as of 07:34, 30 December 2020
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
MacIntosh only!
Converts HSF (using ':' as delimiter) file path to Posix (using '/' as delimiter) file path.
FUNCTION ConvertHSF2PosixPath(
HSFPath :DYNARRAY[] of CHAR;
VAR outPosixPath :DYNARRAY[] of CHAR) : BOOLEAN;
def vs.ConvertHSF2PosixPath(HSFPath): return (BOOLEAN, outPosixPath)
Parameters
HSFPath DYNARRAY[] of CHAR The HSF path that is to be converted. outPosixPath DYNARRAY[] of CHAR Output parameter. Returns the converted path. If the function does not succeed the returned value is the passed 'HSFPath' value.
Return Value
Returns true if the conversion succeeds. False if it fails.
The resulted Posix path will be the same as the passed HSF path if the function fails.
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 HSF path. Interestingly, passing a qualified posix path (needing thus no conversion!) will also return gibberish:
Example:
path2convert := Macintosh HD:Users:user:Desktop:New File.txt ConvertHSF2PosixPath(path2convert, path) --> Macintosh HD:Users:user:Desktop:New File.txt > /Users/user/Desktop/New File.txt --> OK
path2convert := /Users/user/Desktop/New File.txt { <-- this needs no conversion! } ConvertHSF2PosixPath(path2convert, path) --> /Users/user/Desktop/New File.txt > /:Users:user:Desktop:New File.txt --> GIBBERISH
Version
Availability: from Vectorworks 2010
See Also
VS Functions:
VS Functions:
[[VS:ConvertPosix2HSFPath]]