Try using Posix - I know you should not have to....
follows a posix converter - 4D's (at least as of v15 is 
incomplete/incorrect)


  //fileutl_Path_Convert_to_Posix
  // $1 - Text - Path to convert
  //$2 - Pointer (Optional) - to Error Return Text

  //Original from JorgeChB via iNug

  //Converts a Mac file path to a Posix form

  //RETURNS - Text - converted path, or empty string if path is empty
  // • Created 3/24/15 by Chip - 
  //• Updated 05-17-18 by Chip - added test for empty path
C_TEXT($Path;$Path;$0;$msg)
C_POINTER($2;$Error_ptr)

errutl_Start 

If (Count parameters>=1)
$Path:=$1

If (Count parameters>=2)
$Error_ptr:=$2
End if 

Case of 
: ($Path="")
$msg:="Source Path is empty"
errutl_Add ($msg)

: (Position(Colon_Char;$Path)>0)

If ($Path#"")
$Path:=Replace string($Path;Slash_Char;"__-sLaSh-__")  //'a/b' -> 
'a__-sLaSh-__b'
$Path:=Replace string($Path;Colon_Char;Slash_Char)  //'a:b' -> 'a/b'
$Path:=Replace string($Path;"__-sLaSh-__";Colon_Char)  
//'a__-sLaSh-__b' -> 'a:b'
$Path:=Replace 
string($Path;BackSlash_Char;BackSlash_Char+BackSlash_Char)  //'a\\b' -> 
'a\\b'"
$Path:=Replace string($Path;Space_Char;BackSlash_Char+Space_Char)  //'a 
b' -> 'a\ b'
$Path:=Replace string($Path;"*";BackSlash_Char+"*")  //'a*b' -> 'a\*b'
$Path:=Replace string($Path;"'";BackSlash_Char+"'")  //'a'b' -> 'a\'b'
$Path:=Replace string($Path;"&";BackSlash_Char+"&")  //'a&b' -> 'a\&b'
$Path:=Replace string($Path;Quote_Char;BackSlash_Char+Quote_Char)  
//'a"b' -> 'a\"b'
$Path:=Replace string($Path;"(";BackSlash_Char+"(")  //'a(b' -> 'a\(b'
$Path:=Replace string($Path;")";BackSlash_Char+")")  //'a)b' -> 'a\)b'
$Path:=Replace string($Path;"|";BackSlash_Char+"|")  //'a|b' -> 'a\|b'

  //make sure we do not prepend 'Volumes' if it already there
If (Position("/Volumes/";$Path)=0)
$0:="/Volumes/"+$Path
Else 
$0:=$Path
End if 
Else 
errutl_Add ("Source is empty.")
End if 
Else 
$msg:="Posix conversion is only applicable "
$msg:=$msg+"to paths formatted for use on a Macintosh."
errutl_Add ($msg)
End case 
Else 
$msg:="Required parameters (1) not passed."+Cr_Char
$msg:=$msg+"Parameters passed "+String(Count parameters)
errutl_Add ($msg)
End if 

errutl_End (Current method name;$Error_ptr;Nil($Error_ptr))
  //End fileutl_Path_Convert_to_Posix



NOTE: 
- errutl_start initializes an error reporting system
- calls to errutl_add builds a text message to return an error to 
calling method
- BOTH of the above can be removed or ignore or replaced with your own 
error reporter

Chip

On Wed, 30 Oct 2019 11:30:29 +0000, Jeremy Roussak via 4D_Tech wrote:
> I call VP IMPORT DOCUMENT(“vp”;Form.path) in the On VP Ready form 
> event. Form.path contains a path in Mac system format, 
> colon-delimited.
> 
> In v17R5, it works fine. In R6, on the same document, I get an empty 
> spreadsheet. No error; just an empty sheet.
> 
> Mac, Mojave.
> 
> Any suggestions gratefully received.
> 
> Jeremy
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[email protected]
> **********************************************************************
We have done so much, with so little, for so long;
We are now qualified to anything with nothing <sigh>
  - unknown
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to