[Gambas-user] run project as root

Ru Vuott vuott at ...325...
Sun Sep 23 16:33:32 CEST 2012


> > i 've seen in other postingsyou mentioned tests using
> > "Desktop.RunAsRoot("whoami")"
> > Can you provide a working example how to use
> Desktop.RunAsRoot, please ?
> > (e.g. how to get the returned usersname)

Hello Wally,

you could use a supporting file, and then you could read in it...

I'll use my precedent example:

*************************************
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

**********************

  :-)




More information about the User mailing list