Difference between revisions of "VS:ConvertPosix2HSFPath"

From Vectorworks Developer
Jump to: navigation, search
(add remark)
(add remark)
 
Line 40: Line 40:
 
<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 Posix path if the function fails.</return>
+
The resulted Posix path will be the same as the passed Posix path if the function fails.
 +
</return>
  
 
-----------------------------------------------------------------------------------------------------------
 
-----------------------------------------------------------------------------------------------------------
Line 47: Line 48:
  
 
Example:
 
Example:
  path2convert := Macintosh HD:Users:atta2:Desktop:New File.txt
+
  path2convert := /Users/user/Desktop/New File.txt  
  ConvertHSF2PosixPath(path2convert, path)
+
  ConvertPosix2HSFPath(path2convert, path)
  --> Macintosh HD:Users:user:Desktop:New File.txt > /Users/user/Desktop/New File.txt
+
  --> /Users/user/Desktop/New File.txt > Macintosh HD:Users:user:Desktop:New File.txt
 
  --> OK
 
  --> OK
  
  path2convert := /Users/atta2/Desktop/New File.txt { <-- this needs no conversion! }
+
  path2convert := Macintosh HD:Users:user:Desktop:New File.txt { <-- this needs no conversion! }
  ConvertHSF2PosixPath(path2convert, path)
+
  ConvertPosix2HSFPath(path2convert, path)
  --> /Users/user/Desktop/New File.txt > /:Users:user:Desktop:New File.txt
+
  --> Macintosh HD:Users:user:Desktop:New File.txt > :Macintosh HD/Users/user/Desktop/New File.txt
 
  --> GIBBERISH
 
  --> GIBBERISH
 
</remark>
 
</remark>

Latest revision as of 04:32, 16 June 2016

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

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

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.

Return Value

Returns true if the conversion succeeds. False if it fails.

The resulted Posix path will be the same as the passed Posix path if the function fails.

Remarks

(Orso 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

Version

Availability: from Vectorworks 2010

See Also

VS Functions:

VS:ConvertHSF2PosixPath

VS Functions: [[VS:ConvertHSF2PosixPath]]
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox