4D v13.4

Convert path system to POSIX

Home

 
4D v13.4
Convert path system to POSIX

Convert path system to POSIX 


 

Convert path system to POSIX ( systemPath {; *} ) -> Function result 
Parameter Type   Description
systemPath  Text in Relative or absolute pathname expressed in system syntax
Operator in Encoding option
Function result  Text in Absolute pathname expressed in POSIX syntax

The Convert path system to POSIX command converts a pathname expressed with the system syntax as a pathname expressed with the POSIX (Unix) syntax.

Pass the pathname for a file or folder in the systemPath parameter, expressed with the system syntax (Mac OS or Windows). This path may be absolute or relative to the database folder (folder containing the database structure file). It is not mandatory that the elements of the path actually exist on the disk at the time the command is executed (the command does not test the validity of the pathname). 

The command returns the complete pathname of the file or folder expressed in the POSIX syntax. The command always returns an absolute pathname, regardless of the type of path passed in systemPath. If you passed a relative pathname in systemPath, 4D completes the value returned by adding the pathname of the database folder. 

The optional * parameter can be used to specify the encoding of the POSIX path. By default, Convert path system to POSIX does not encode the special characters of the POSIX path. If you pass the * parameter, the special characters are translated (for example, "My folder" becomes "My%20folder").

Example under Mac OS

 $path:=Convert path system to POSIX("machd:file 2.txt")
  `returns "/Volumes/machd/file 2.txt" (even if machd is the startup disk)
 $path:=Convert path system to POSIX("machd:file 2.txt";*)
  `returns "/Volumes/machd/file%202.txt"
 $path:=Convert path system to POSIX("resources:images")
  `returns "/Volumes/machd/bases/basevideo/resources/images"

Example under Windows

 $path:=Convert path system to POSIX("c:\docs\file 2.txt")
  `returns "c:/docs/file 2.txt"
 $path:=Convert path system to POSIX("\\srv\tempo\file.txt")
  `returns "//srv/tempo/file.txt"

 
PROPERTIES 

Product: 4D
Theme: System Documents
Number: 1106

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D v12

 
SEE ALSO 

Convert path POSIX to system
Test path name

 
TAGS 

POSIX, Chemin accès***