Platforms to show: All Mac Windows Linux Cross-Platform

Back to LargeBinaryStreamMBS class.

LargeBinaryStreamMBS.Create(file as folderitem, MacType as string, MacCreator as string) as LargeBinaryStreamMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Files MBS Util Plugin 12.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a file as a LargeBinaryStreamMBS.
Example
dim f as FolderItem // your file
dim l as LargeBinaryStreamMBS

l = LargeBinaryStreamMBS.Create(f, "TEXT","ttxt")

If there is already a file, it is deleted.
On Windows the parameters are ignored.
Returns nil on any error.

See also:

LargeBinaryStreamMBS.Create(path as string, MacType as string, MacCreator as string, WinShareMode as Integer = 0) as LargeBinaryStreamMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Files MBS Util Plugin 12.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a file as a LargeBinaryStreamMBS.
Example
dim l as LargeBinaryStreamMBS
l = LargeBinaryStreamMBS.Create("C:\test.txt", "", "")

If there is already a file, it is deleted.
On Windows the parameters are ignored.
Returns nil on any error.

See also:

LargeBinaryStreamMBS.CreateResStream(file as folderitem, MacType as string, MacCreator as string) as ResStreamMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Files MBS Util Plugin 12.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a new ResStreamMBS.

If there is already a file, it is deleted.
If the file could not be created it is deleted.
Returns nil on any error.

See also:

LargeBinaryStreamMBS.CreateResStream(path as string, MacType as string, MacCreator as string) as ResStreamMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Files MBS Util Plugin 12.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a new ResStreamMBS.

If there is already a file, it is deleted.
If the file could not be created it is deleted.
Returns nil on any error.

See also:

LargeBinaryStreamMBS.DeleteDataFork(file as folderitem)

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Files MBS Util Plugin 12.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Deletes the data fork of a file.

Equal to open the file using a binarystream and setting the length property to 0.
On Mac OS a file can exist without a datafork, with a resource fork or even without any fork.

LargeBinaryStreamMBS.DeleteResourceFork(file as folderitem)

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Files MBS Util Plugin 12.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Deletes the resource fork of a file.

Equal to open the file using a ResStreamMBS and setting the length property to 0.
On Mac OS a file can exist without a datafork, with a resource fork or even without any fork.

LargeBinaryStreamMBS.Open(file as folderitem, write as Boolean) as LargeBinaryStreamMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Files MBS Util Plugin 12.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Opens a file as a LargeBinaryStreamMBS.
Example
dim l as LargeBinaryStreamMBS
dim f as FolderItem = SpecialFolder.Desktop.Child("testfile")

l = LargeBinaryStreamMBS.Open(f, true)

Returns nil on any error.

See also:

LargeBinaryStreamMBS.Open(path as string, write as Boolean, WinShareMode as Integer = 0) as LargeBinaryStreamMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Files MBS Util Plugin 12.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Opens a file as a LargeBinaryStreamMBS.
Example
// write to parallel port:
dim b as LargeBinaryStreamMBS = LargeBinaryStreamMBS.Open("LPT1", true, 3)
b.Write "Hello World"
b.Close

Returns nil on any error.
For special cases, you may need to allow Shared Read or Write and for that case, we have WinShareMode parameter.
For WinShareMode, you can pass 1 for shared reading, 2 for shared writing, 4 for shared deletion. Or combine those. Passing zero prevents sharing.

See also:

LargeBinaryStreamMBS.OpenAsResStream(file as folderitem, write as Boolean) as ResStreamMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Files MBS Util Plugin 12.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Opens a file's resourcefork as a ResStreamMBS.

Returns nil on any error.

See also:

LargeBinaryStreamMBS.OpenAsResStream(path as string, write as Boolean) as ResStreamMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Files MBS Util Plugin 12.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Opens a file's resourcefork as a ResStreamMBS.

Returns nil on any error.

See also:

LargeBinaryStreamMBS.WinCreateStream(file as folderitem, StreamName as String, WinShareMode as Integer = 0) as LargeBinaryStreamMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Files MBS Util Plugin 16.4 ❌ No ✅ Yes ❌ No ❌ No All
Creates a named stream in a file.
Example
dim f as FolderItem = SpecialFolder.Desktop.Child("test.txt")
dim l as LargeBinaryStreamMBS = LargeBinaryStreamMBS.WinCreateStream(f, "test")
if l = nil then
MsgBox "Error
else
l.Write "Hello"
l.close
end if

Returns nil in case of error.

Some examples using this method:

LargeBinaryStreamMBS.WinDeleteStream(file as folderitem, StreamName as String) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Files MBS Util Plugin 16.4 ❌ No ✅ Yes ❌ No ❌ No All
Deletes a named stream in a file.
Example
dim f as FolderItem = SpecialFolder.Desktop.Child("test.txt")
if LargeBinaryStreamMBS.WinDeleteStream(f) then
MsgBox "OK"
else
MsgBox "Error
end if

Returns true on success.

LargeBinaryStreamMBS.WinOpenStream(file as folderitem, StreamName as String, write as Boolean, WinShareMode as Integer = 0) as LargeBinaryStreamMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Files MBS Util Plugin 16.4 ❌ No ✅ Yes ❌ No ❌ No All
Opens a named stream in a file.
Example
dim f as FolderItem = SpecialFolder.Desktop.Child("test.txt")
dim l as LargeBinaryStreamMBS = LargeBinaryStreamMBS.WinOpenStream(f, "test", false)
if l = nil then
MsgBox "Error
else
MsgBox l.Read(l.Length)
end if

Returns nil in case of error.

Some examples using this method:

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


The biggest plugin in space...