I receive an excel file of data from a client, and in this data is a file path which is in POSIX format. I need to use this path to replicate their folder structure, but I can’t use the path in the shell as it is provided. Certain characters are escaped (space, hyphen) within the ShellPath, otherwise the path formats are similar. I can do a ReplaceAll on the POSIX path:
folderPath = folderPath.ReplaceAll(" ", "\\ ")
folderPath = folderPath.ReplaceAll("-", "\\-")
… but I’m not sure if there are any other characters I would need to escape, and I’d prefer if there’s a more proper way to do so.
Is there a built-in way to do this conversion? I have MacOSLib included within this project, which allows me to get the POSIX Path of a FolderItem, but not to convert it to a ShellPath, and I don’t believe there’s a way to use it to specify the path is a POSIX path for the FolderItem Constructor.
Alternately, if I have to ‘roll my own’, are there any other characters which I need to escape?