[Gambas-user] run project as root
Jussi Lahtinen
jussi.lahtinen at ...626...
Sun Sep 23 17:29:03 CEST 2012
> Private fl As File
>
>
> Public Sub Form_Open()
>
> Desktop.RunAsRoot("cat /dev/ttyUSB1 > /tmp/a")
>
> fl = Open "/tmp/a" For Read Watch
>
> End
>
>
> Public Sub File_Read()
>
> Dim s As String
>
> s = File.Load("/tmp/a")
>
> TextEdit1.Text = s
>
> End
>
This is good idea, but instead of "/tmp/a", I would use Temp$():
Private fl As File
Private sFile As String
Public Sub Form_Open()
sFile = Temp$()
Desktop.RunAsRoot("cat /dev/ttyUSB1 > " & sFile)
fl = Open sFile For Read Watch
End
Public Sub File_Read()
Dim s As String
s = File.Load(sFile)
TextEdit1.Text = s
End
Jussi
More information about the User
mailing list