[Mono-list] command
Fabian
fseoane@wanadoo.es
Mon, 09 Aug 2004 17:10:42 +0200
--=-EH/0fm+Oa4lX9v3yIi+q
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
El lun, 09-08-2004 a las 14:57, Jonathan Stowe escribi=F3:
> On Mon, 2004-08-09 at 14:15, Fabian wrote:
> > Hi!. If i'm not wrong, if i want to execute a shell command like "ls
> > -lh" I must paste the following code:=20
> >=20
> > System.Diagnostics.Process proc =3D new
> > System.Diagnostics.Process();=20
> > proc.EnableRaisingEvents=3Dfalse;
> > proc.StartInfo.FileName=3D "ls";=20
> > proc.StartInfo.Arguments =3D "-lh";=20
> > proc.Start();=20
> > proc.WaitForExit();=20
> >=20
> > The problem is that it doesen't work unless i'm root. Otherwise I get:
> >=20
> > Unhandled Exception: System.ComponentModel.Win32Exception: Cannot find
> > the specified file
> > in <0x00657> System.Diagnostics.Process:Start_common
> > (System.Diagnostics.ProcessStartInfo,System.Diagnostics.Process)
> > in <0x0003d> System.Diagnostics.Process:Start
> > (System.Diagnostics.ProcessStartInfo)
> > in <0x00029> System.Diagnostics.Process:Start (string)
> > in <0x0000f> prueba:Main ()
> >=20
> >=20
> > Is there a way to execute a shell command without being root ?
>=20
> Your exact code works fine for me - it is almost something certainly
> strange about your system rather than with mono. What OS are you trying
> to run this on?
I'm running Debian Sid.
Thanks for the info, i'll hack a bit to see what's wrong.
>=20
> /J\
>=20
> _______________________________________________
> Mono-list maillist - Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
--=-EH/0fm+Oa4lX9v3yIi+q
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.0.9">
</HEAD>
<BODY>
El lun, 09-08-2004 a las 14:57, Jonathan Stowe escribió:
<BLOCKQUOTE TYPE=CITE>
<PRE><FONT COLOR="#737373"><I>On Mon, 2004-08-09 at 14:15, Fabian wrote:
> Hi!. If i'm not wrong, if i want to execute a shell command like "ls
> -lh" I must paste the following code:
>
> System.Diagnostics.Process proc = new
> System.Diagnostics.Process();
> proc.EnableRaisingEvents=false;
> proc.StartInfo.FileName= "ls";
> proc.StartInfo.Arguments = "-lh";
> proc.Start();
> proc.WaitForExit();
>
> The problem is that it doesen't work unless i'm root. Otherwise I get:
>
> Unhandled Exception: System.ComponentModel.Win32Exception: Cannot find
> the specified file
> in <0x00657> System.Diagnostics.Process:Start_common
> (System.Diagnostics.ProcessStartInfo,System.Diagnostics.Process)
> in <0x0003d> System.Diagnostics.Process:Start
> (System.Diagnostics.ProcessStartInfo)
> in <0x00029> System.Diagnostics.Process:Start (string)
> in <0x0000f> prueba:Main ()
>
>
> Is there a way to execute a shell command without being root ?
Your exact code works fine for me - it is almost something certainly
strange about your system rather than with mono. What OS are you trying
to run this on?</I></FONT></PRE>
</BLOCKQUOTE>
<BR>
I'm running Debian Sid.<BR>
<BR>
Thanks for the info, i'll hack a bit to see what's wrong.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE><FONT COLOR="#737373"><I>
/J\
_______________________________________________
Mono-list maillist - Mono-list@lists.ximian.com</FONT>
<A HREF="http://lists.ximian.com/mailman/listinfo/mono-list"><U>http://lists.ximian.com/mailman/listinfo/mono-list</U></I></A></PRE>
</BLOCKQUOTE>
</BODY>
</HTML>
--=-EH/0fm+Oa4lX9v3yIi+q--