Platforms to show: All Mac Windows Linux Cross-Platform

Back to ResourceForkMBS class.

ResourceForkMBS.Create(file as folderitem, UseDataFork as boolean = false) as ResourceForkMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Files MBS MacClassic Plugin 13.0 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates a new ResourceFork.
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"

If the file has a resource fork, it is deleted first.
If the file does not exist, it is created.
Returns nil on any error.
If UseDataFork is true, the resources are read/write from data fork.

ResourceForkMBS.Open(file as folderitem, Write as boolean, UseDataFork as boolean = false) as ResourceForkMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Files MBS MacClassic Plugin 13.0 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Opens the resource fork of the FolderItem.
Example
dim f as FolderItem = SpecialFolder.Desktop.Child("test.rsrc")
dim r as ResourceForkMBS = ResourceForkMBS.Open(f, false)
MsgBox str(r.TypeCount)+" types in file"

If the FolderItem has no resource fork, OpenResourceFork returns Nil.
Access to the resourcefork is supported only on Macintosh.
If UseDataFork is true, the resources are read/write from data fork.

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


The biggest plugin in space...