[Gambas-user] run project as root

Ru Vuott vuott at ...325...
Sun Sep 23 18:59:54 CEST 2012


> I tried:
> 
>  sFile = Temp$()
>  Desktop.RunAsRoot("whoami > " & sFile)
> 
>  Do
>    Wait 0.1
>  Loop Until Exist(sFile)
> 
>  fl = Open sFile For Read Watch
> 

I tried your code, and I obtain in TextEdit simply the word:  root

(But I should be getting: vuott)

----------

In the meantime, I have experienced the reading of another Terminal by all its file-descriptors:
******
....
Desktop.RunAsRoot("cat /proc/29895/fd/0 > " & sFile)
 
 fl = Open sFile For Read Watch

....
*****************
but in my TextEdit I obtain what I write manually in the terminal, not resulting data of command.
So, this solution should be discarded.

bye




More information about the User mailing list