nativePath question

Hi All.

Quick question. I want to access a folder that is on an external drive with a name like “DO NOT ERASE THIS EVER”.

If I look at

(app.theNativePathChosenForVideoFolder.NativePath)
which is a shared folderitem.

I get the “right” path i.e.

/Volumes/DO NOT ERASE THIS EVER/Batman Adventures

But because of the spaces in the drive, my attempt to access the folder fails.

How would I get around this?
Any ideas?

Regards

Usually when there are spaces in a path of document name, you enclose the complete path in double quotes, in you case:

“/Volumes/DO NOT ERASE THIS EVER/Batman Adventures”

The quotes have to be inside the string as shown above.

HTH

Should be noted that you don’t need to worry about the quotes within Xojo, it’s only when you shell to a console command that the quotes come into play. Also, it’s worth noting that on MacOS you’ll need single quotes and not double quotes ’ and you’ll also need to escape some characters too.

Because of this, you’re better off using .ShellPath over .NativePath when you’re running external programs because it will give you the pathname for your OS with all the quotes and escapes that you’ll need to use that FolderItem in a command line.

3 Likes

In maxOS you can use ‘ or “
Also, for nativePath you do not need to escape chars. That’s only needed for shellPath (and without using ‘ or “)