ResourceForkMBS shared methods

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

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.


💬 Ask a question or report a problem