Platforms to show: All Mac Windows Linux Cross-Platform

/Util/File Lock


Required plugins for this example: MBS Util Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Util/File Lock

This example is the version from Sun, 17th Mar 2012.

Project "File Lock.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() l = nil dim f as FolderItem = SpecialFolder.Desktop.Child("test.txt") l = f.CreateLargeBinaryStreamMBS("","") if l = nil then MsgBox "Failed to create file." else l.Write "Hello World" end if End EventHandler
End Control
Control PushButton2 Inherits PushButton
ControlInstance PushButton2 Inherits PushButton
EventHandler Sub Action() MsgBox str(l.lockFileExclusive) End EventHandler
End Control
Control PushButton3 Inherits PushButton
ControlInstance PushButton3 Inherits PushButton
EventHandler Sub Action() MsgBox str(l.UnlockFileExclusive) End EventHandler
End Control
Control PushButton4 Inherits PushButton
ControlInstance PushButton4 Inherits PushButton
EventHandler Sub Action() l=nil End EventHandler
End Control
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control PushButton5 Inherits PushButton
ControlInstance PushButton5 Inherits PushButton
EventHandler Sub Action() l = nil dim f as FolderItem = SpecialFolder.Desktop.Child("test.txt") l = f.OpenAsLargeBinaryStreamMBS(False) if l = nil then MsgBox "Failed to open file." else end if End EventHandler
End Control
Control PushButton6 Inherits PushButton
ControlInstance PushButton6 Inherits PushButton
EventHandler Sub Action() l = nil dim f as FolderItem = SpecialFolder.Desktop.Child("test.txt") l = f.OpenAsLargeBinaryStreamMBS(true) if l = nil then MsgBox "Failed to open file." else end if End EventHandler
End Control
Property l As LargeBinaryStreamMBS
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
End Project

See also:

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


The biggest plugin in space...