Platforms to show: All Mac Windows Linux Cross-Platform

Back to FolderItem class.

FolderItem.UnixpathMBS as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS MacOSX Plugin ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the native path for the file.
Example
dim sh as Shell
dim fi as FolderItem
dim s as String
dim t as TextConverter

sh = new Shell
fi = getfolderitem("test √") // or try some other file name

if fi = nil or fi.exists = false then
beep
return
end if

s="ls -al """ + fi.Unixpathmbs + """"

sh.Execute s
MsgBox sh.Result

test on the Desktop could be this:
On Mac OS X: /Users/cs/Desktop/test
On Mac OS 9: Mac OS 9:Desktop folder:test
On Windows: c:\windows\desktop\test

This function will return an empty string if the path can not be encoded in a Xojo String. For my tests ICQ's path which is includes the folder name "ICQ 3.0 ƒ" can not be converted to MacRoman for some reason.

On Mac OS X this function returns the posix path. So if you are looking for POSIXPathMBS or PosixPath this method is it.
This function should do the same as NativePath in Xojo 2013r1.

Some examples using this method:

Blog Entries

The items on this page are in the following plugins: MBS MacOSX Plugin.


The biggest plugin in space...