> Il domenica 3 ottobre 2010 18:46:38 Jussi Lahtinen ha scritto: > > No, with Ubuntu 10.04 it does not work. > > Textbox.Text is "", because shell is executed before textbox is even > > shown. > > > > Your original code gives result: > > *Password: > > Password: > > su: Authentication failure* > > Then form appears, and after that when write password and click > > "confirm", you will get error message from gambas "System error. Bad > > file descriptor". Error is given from line: > > *PRINT #hProcess, TextBox1.Text* > > > > Jussi > > Well, I'm on Slackware 32 bit. I switch the code to gb.gtk and still works > here. I don't know. Maybe a Ubuntu 64 bit issue? > > >Then form appears, and after that when write password and click "confirm", > > > > you will get error message from gambas "System error. Bad file > > descriptor". > > I get this error when I try a second time, because after the first try > the code inside Form_Open is not run again. It was an example on the fly > to show howto su. > > Change the Button_Click code to: > > PUBLIC SUB Button1_Click() > > PRINT #hProcess, TextBox1.Text > WAIT > TRY hProcess.Kill > hProcess = SHELL "su -c 'ls /root'" FOR INPUT OUTPUT > > END > > This should fix the Bad descriptor error. For the first error I suppose is > something with 64 bit. don't know. >
Can I see the project? -- Benoît Minisini ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user