FolderItem.CreateFromMacFSRef

From Xojo Documentation

Shared Method


FolderItem.CreateFromMacFSRef(theFSRef as MemoryBlock) As FolderItem

New in 2010r5

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

See Also

PlatformNotSupportedException.