X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Date: Fri, 21 Jan 2005 18:39:28 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: djgpp AT delorie DOT com Message-ID: <01c4ffd7$Blat.v2.4$eb8797c0@zahav.net.il> Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=ISO-8859-1 X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 2.4 In-reply-to: (message from Andrew Paulsen on Fri, 21 Jan 2005 08:42:52 -0600) Subject: Re: ls.exe in execv References: Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Date: Fri, 21 Jan 2005 08:42:52 -0600 > From: Andrew Paulsen > > Second, why are you passing the path to ls in the argv[] parameter? > The following worked for me: > > #include > #include > #include > int main() { > int retval; > > char *myArgv[] = {"C:\\", NULL}; > retval = execv("C:\\djgpp\\bin\\ls.exe", myArgv); This is wrong: myArgv[0] should be the program's name, i.e. "ls" or some such. myArgv[1] is passed to ls as its 1st command-line argument.