Platforms to show: All Mac Windows Linux Cross-Platform

ResourceForkMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Files MBS MacClassic Plugin 13.0 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
This class is for reading/writing resource forks on Mac.
Example
dim f as FolderItem = SpecialFolder.Desktop.Child("test.rsrc")
dim r as ResourceForkMBS = ResourceForkMBS.Create(f)

r.AddResource "Hello World", "TEXT", 128, "just a test"

It is a replacement for ResourceFork class in Xojo which has been removed for Cocoa and Console targets in Xojo version 2012r2.

Resourcefork methods are deprecated by Apple, but work in 32 and 64-bit applications as of MBS Plugin version 19.5.
This is an abstract class. You can't create an instance, but you can get one from various plugin functions.

  • 11 properties
  • 15 methods
    • method AddResource(Data as Memoryblock, ResourceType as String, ID as Integer, Name as String)
    • method AddResource(Data as String, ResourceType as String, ID as Integer, Name as String)
    • method Close
    • method Constructor   Private
    • method GetIndResource(ResourceType as String, index as Integer) As String
    • method GetNamedResource(ResourceType as String, Name as String) As String
    • method GetResource(ResourceType as String, ID as Integer) As String
    • method GetResourceMemory(ResourceType as String, ID as Integer) As Memoryblock
    • method RemoveResource(ResourceType as String, ID as Integer)
    • method ResourceCount(ResourceType as String) as Integer
    • method ResourceID(ResourceType as String, index as Integer) as Integer
    • method ResourceName(ResourceType as String, index as Integer) As String
    • method ResourceSizeOnDisk(ResourceType as String, ID as Integer) as Integer
    • method ResourceType(index as Integer) As String
    • method UniqueID(ResourceType as String) as Integer
  • 2 shared methods
    • shared method Create(file as folderitem, UseDataFork as boolean = false) as ResourceForkMBS
    • shared method Open(file as folderitem, Write as boolean, UseDataFork as boolean = false) as ResourceForkMBS

This class has no sub classes.

Some examples using this class:

Blog Entries

Release notes


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


ResolutionMBS   -   ResStreamMBS


The biggest plugin in space...