FolderItem.CreateFromMacFSRef
From Xojo Documentation
This item was deprecated in version 2019r2. |
Shared Method
This method is only available on the macOS platform. For cross-platform compatibility, use #If...#Endif with the Target... specifiers to make sure you will not attempt to use this method on an incompatible platform. |
Creates a FolderItem from the passed FSRef.
Notes
The method takes a MemoryBlock of size 80 containing a Mac OS FSRef structure that can be obtained from various Carbon File Manager functions, usually using the Declare statement.
This will only work on macOS. On Windows and Linux it raises a PlatformNotSupportedException.
Sample Code
For purposes of illustration, this example creates a FolderItem from an internaly-generated MemoryBlock that contains a user-selected mp4 file.
Dim f As New FolderItem
Dim g As New FolderItem
f = GetOpenFolderItem("video/mp4") // added using the File Types Editor
If f.MacFSRef <> Nil Then
g = f.CreateFromMacFSRef(f.MacFSRef)
MsgBox(g.NativePath)
Else
MsgBox("The MacFSRef was not created.")
End If
Dim g As New FolderItem
f = GetOpenFolderItem("video/mp4") // added using the File Types Editor
If f.MacFSRef <> Nil Then
g = f.CreateFromMacFSRef(f.MacFSRef)
MsgBox(g.NativePath)
Else
MsgBox("The MacFSRef was not created.")
End If