473,785 Members | 2,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

execlp() - mystery arg

as i understand if, the first argument of execlp() is a null terminated
string containing the path of the command which to be executed.

the second argument is an array of pointers to null terminated strings,
containing the arguments to be passed to said command, ending in a null
pointer.

my question is, what does the third argument do?
Nov 14 '05 #1
6 5336
Erik S. Bartul <ad***@phork.ne t> scribbled the following:
as i understand if, the first argument of execlp() is a null terminated
string containing the path of the command which to be executed. the second argument is an array of pointers to null terminated strings,
containing the arguments to be passed to said command, ending in a null
pointer. my question is, what does the third argument do?


Something POSIX-specific. Ask in comp.unix.progr ammer.

--
/-- Joona Palaste (pa*****@cc.hel sinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
Nov 14 '05 #2

"Erik S. Bartul" <ad***@phork.ne t> wrote in message
news:z90Yb.4152 6$yE5.169277@at tbi_s54...
as i understand if, the first argument of execlp() is a null terminated
string containing the path of the command which to be executed.

the second argument is an array of pointers to null terminated strings,
containing the arguments to be passed to said command, ending in a null
pointer.

my question is, what does the third argument do?

excelp() allows you to pass the arguments as a list strings terminated by 0:
e.g

execlp("MyProgr am","parm1","pa rm2","another parm", (char *) 0);

The function you were (almost) describing is execvp() which takes the first
two parameters as you describe above but there is no third parameter....

Sean
Nov 14 '05 #3
Erik S. Bartul wrote:
as i understand if, the first argument of execlp() is a null terminated
string containing the path of the command which to be executed. the second argument is an array of pointers to null terminated strings,
containing the arguments to be passed to said command, ending in a null
pointer. my question is, what does the third argument do?


This terminates the argument list. man execlp.

/david

--
Andre, a simple peasant, had only one thing on his mind as he crept
along the East wall: 'Andre, creep... Andre, creep... Andre, creep.'
-- unknown
Nov 14 '05 #4
Erik S. Bartul <ad***@phork.ne t> wrote:
as i understand if, the first argument of execlp() is a null terminated
string containing the path of the command which to be executed. the second argument is an array of pointers to null terminated strings,
containing the arguments to be passed to said command, ending in a null
pointer. my question is, what does the third argument do?


There is no such function is standard C. You may want to try:

comp.unix.progr ammer

Or, failing that, the documentation on your system. Seriously.

--
Alex Monjushko (mo*******@hotm ail.com)
Nov 14 '05 #5
On Mon, 16 Feb 2004 16:41:34 +0000 (UTC), "Sean Kenwrick"
<sk*******@hotm ail.com> wrote in comp.lang.c:

"Erik S. Bartul" <ad***@phork.ne t> wrote in message
news:z90Yb.4152 6$yE5.169277@at tbi_s54...
as i understand if, the first argument of execlp() is a null terminated
string containing the path of the command which to be executed.

the second argument is an array of pointers to null terminated strings,
containing the arguments to be passed to said command, ending in a null
pointer.

my question is, what does the third argument do?

excelp() allows you to pass the arguments as a list strings terminated by 0:
e.g

execlp("MyProgr am","parm1","pa rm2","another parm", (char *) 0);

The function you were (almost) describing is execvp() which takes the first
two parameters as you describe above but there is no third parameter....

Sean


Please cite the references from any version of the ISO C Standard for
the above.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.l earn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Nov 14 '05 #6
Sean Kenwrick wrote:
"Erik S. Bartul" <ad***@phork.ne t> wrote in message
as i understand if, the first argument of execlp() is a null terminated
string containing the path of the command which to be executed.

the second argument is an array of pointers to null terminated strings,
containing the arguments to be passed to said command, ending in a null
pointer.

my question is, what does the third argument do?

excelp() allows you to pass the arguments as a list strings terminated by 0:
e.g

execlp("MyProgr am","parm1","pa rm2","another parm", (char *) 0);

The function you were (almost) describing is execvp() which takes the first
two parameters as you describe above but there is no third parameter....


Please DO NOT post answers to off-topic questions in c.l.c. Refer
the OP to an appropriate newsgroup, where other posters are likely
to be able to criticise any faulty answers.

To the OP: Close to 50% of all answers posted anywhere are wrong
to some degree or other. Your only protection is to have this go
on in the open under the scrutiny of people knowledgeable about
the subject. execlp() does not exist in standard C, and thus does
not exist in c.l.c and we have absolutely no knowledge about it.

--
Chuck F (cb********@yah oo.com) (cb********@wor ldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net> USE worldnet address!
Nov 14 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1970
by: Red | last post by:
In netscape bookmark files, there are lots of lines like this: <DT><A HREF="http://www.commondreams.org/" ADD_DATE="1091500674" LAST_CHARSET="ISO-8859-1" ID="rdf:#$uiYyb3">Common Dreams</A> I want to eliminate the excess attributes and values to get this: <DT><A HREF="http://www.commondreams.org/">Common Dreams</A> I almost succeed with this: $lines=preg_replace("{(<A HREF=\".*\")( ADD.*)(>.*</A>)}","\\1\\3", $line);
1
3583
by: Melissa Wallis | last post by:
In a Python script I start a number of C++ processes using os.execlp. Most of these processes output messages for debugging purposes at this time. The problem I am having is that by starting 4 or 5 processes from my Python script I don't get the cout messages they write. I have tried redirecting stdout to a file but I get everything but the output from the C++ processes. Any suggestions. Thanks Melissa
4
10043
by: Paul Nilsson | last post by:
Hi, Does anyone know how to redirect text output when issuing a system or an execlp call? I have a GUI that insists on opening up a console whenever I give a system function call, and I would like to redirect the text output to a char buffer instead. Paul
0
1770
by: William Wisnieski | last post by:
Hello Everyone: I'm having a very strange problem occurring with my Access 2000 database. I call it the "mystery record." Here's the story: I have a query by form that returns a record set in a datasheet. The user double clicks on a row in that datasheet and a main form (pop up) opens bound to a table with a continuous subform bound to a query.
115
7646
by: Mark Shelor | last post by:
I've encountered a troublesome inconsistency in the C-language Perl extension I've written for CPAN (Digest::SHA). The problem involves the use of a static array within a performance-critical transform function. When compiling under gcc on my big-endian PowerPC (Mac OS X), declaring this array as "static" DECREASES the transform throughput by around 5%. However, declaring it as "static" on gcc/Linux/Intel INCREASES the throughput by...
14
2795
by: jojoba | last post by:
Hi, I hope this post is ok for this group. Here's my deal: I have two computers on my LAN at home. One desktop. One laptop. Both computers are wireless enabled (and wired enabled too). I have running a fairly simple HTTP server (written in python) that i
6
2824
by: rabidmonkey | last post by:
Hi all, I have written a server & child program both are working fine but when the server tries to execute the child program with the line execlp("child","child", parameter, NULL ); nothing happens it does not call it, yet if I test the above line by substituting child with a system binary like pwd or ls it calls it without trouble. I have used the command "chmod a+x child" to make child executable but still to run child manually at the...
6
2461
by: druidamix | last post by:
I'm trying to make a gui for an application, but it not run. i'm trying to send the output of execlp to pipe and read from his father. but i don't obtain results. Any advince? Thank you. This is the code:
2
3255
by: manontheedge | last post by:
I'm trying to write a program in C on Linux where the child processes get their process images replaced. I have in my code, a few child processes that I forked from a single parent process. I'm then attempting to replace their ( the child ) process images with separate executables. I have these executables written and placed in the directory. My problem is when I'm using execlp. When it reaches execlp in my code, it does replace the...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10325
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10091
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6739
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.