[Gambas-user] run project as root

Jussi Lahtinen jussi.lahtinen at ...626...
Sun Sep 23 18:29:32 CEST 2012


I tried:

 sFile = Temp$()
 Desktop.RunAsRoot("whoami > " & sFile)

 Do
   Wait 0.1
 Loop Until Exist(sFile)

 fl = Open sFile For Read Watch

But I can only get:
Try `whoami --help' for more information.

Same command works in terminal:
whoami > /tmp/gambas.1000/2413/6.tmp


So, I'm not sure what is going on... I will look this closer later, when I
have more time.

Jussi





On Sun, Sep 23, 2012 at 7:17 PM, Ru Vuott <vuott at ...325...> wrote:

> > --- Dom 23/9/12, Jussi Lahtinen <jussi.lahtinen at ...626...> ha scritto:
>
> >
> > 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
> >
> ---------------------------------------------------------------------------
>
> Well Jussi,
>
> the solution is simple, if we use CAT command, because we can re-direct
> data to a supporting file by:  >
>
> but... if we can read data from a different command ? ...e.g: "whoami"
> I cannot "read from" Terminal window by Gambas function.
> I am able to write in it, but I can not read yet from a Terminal. :-(
>
> Do you have a solution ?
>
> Bye
> vuotttt
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://ad.doubleclick.net/clk;258768047;13503038;j?
> http://info.appdynamics.com/FreeJavaPerformanceDownload.html
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list