473,320 Members | 1,695 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

execvp() on Solaris

I've seen it addressed in searching, but not specifically what is
recommended to get around it. On Linux where I did my development all
was fine. But then going to Solaris for the target I found I couldn't
resolve the errors wrt execvp(). It's apparently not syntax, but I
could be wrong. Any other thoughts on how to get execvp() working
and/or how to cat a file in a new window without bringing tkinter into
the discussion?

My example:
os.system("xterm -geometry 120x20 -e \"tail -f ./logs/DATAFILE\"&")

Thank you!
Mike
Jul 18 '05 #1
7 2537
mikeSpindler wrote:
I've seen it addressed in searching, but not specifically what is
recommended to get around it. On Linux where I did my development all
was fine. But then going to Solaris for the target I found I couldn't
resolve the errors wrt execvp(). It's apparently not syntax, but I
could be wrong. Any other thoughts on how to get execvp() working
and/or how to cat a file in a new window without bringing tkinter into
the discussion?

My example:
os.system("xterm -geometry 120x20 -e \"tail -f ./logs/DATAFILE\"&")


I'm not sure I understand the question. You ask about os.execvp, but
then bring up an example for os.system, which is something entirely
different.

As for this os.system call: it should work fine if xterm is in the path,
if DISPLAY is set, and if ./log/DATAFILE exists (and if tail is in the
path, which it should be).

Regards,
Martin
Jul 18 '05 #2
On Mon, 18 Oct 2004, mikeSpindler wrote:
resolve the errors wrt execvp(). It's apparently not syntax, but I
could be wrong. Any other thoughts on how to get execvp() working
and/or how to cat a file in a new window without bringing tkinter into
the discussion?

My example:
os.system("xterm -geometry 120x20 -e \"tail -f ./logs/DATAFILE\"&")


AFAICS, this should be
os.system('xterm -geometry 120x20 -e \"tail -f ./logs/DATAFILE\"&')

But os.system() is not os.execvp()...

You don't elucidate what your problems with execvp() are..., but if what
you have works on Linux but not Solaris I'd have to wonder about the
environment setup for the account:-
- path?
- library path (for X11 libs)?
- different shell?

With execvp(), the shell shouldn't be involved unless you explicitly
execute it so you won't get shell variable expansion or asynchronous
execution (the '&' above).

-------------------------------------------------------------------------
Andrew I MacIntyre "These thoughts are mine alone..."
E-mail: an*****@bullseye.apana.org.au (pref) | Snail: PO Box 370
an*****@pcug.org.au (alt) | Belconnen ACT 2616
Web: http://www.andymac.org/ | Australia
Jul 18 '05 #3
You might not be aware - os.system calls execvp. Thus, when I call
os.system I'm getting execvp errors when I run on Solaris. Thank you
for the responses so far. I'd love to hear how to resolve the known
issue of Python not using the system's execvp. THANK YOU!
Andrew MacIntyre <an*****@bullseye.apana.org.au> wrote in message news:<ma**************************************@pyt hon.org>...
On Mon, 18 Oct 2004, mikeSpindler wrote:
resolve the errors wrt execvp(). It's apparently not syntax, but I
could be wrong. Any other thoughts on how to get execvp() working
and/or how to cat a file in a new window without bringing tkinter into
the discussion?

My example:
os.system("xterm -geometry 120x20 -e \"tail -f ./logs/DATAFILE\"&")


AFAICS, this should be
os.system('xterm -geometry 120x20 -e \"tail -f ./logs/DATAFILE\"&')

But os.system() is not os.execvp()...

You don't elucidate what your problems with execvp() are..., but if what
you have works on Linux but not Solaris I'd have to wonder about the
environment setup for the account:-
- path?
- library path (for X11 libs)?
- different shell?

With execvp(), the shell shouldn't be involved unless you explicitly
execute it so you won't get shell variable expansion or asynchronous
execution (the '&' above).

-------------------------------------------------------------------------
Andrew I MacIntyre "These thoughts are mine alone..."
E-mail: an*****@bullseye.apana.org.au (pref) | Snail: PO Box 370
an*****@pcug.org.au (alt) | Belconnen ACT 2616
Web: http://www.andymac.org/ | Australia

Jul 18 '05 #4
mikeSpindler wrote:
You might not be aware - os.system calls execvp. Thus, when I call
os.system I'm getting execvp errors when I run on Solaris. Thank you
for the responses so far. I'd love to hear how to resolve the known
issue of Python not using the system's execvp. THANK YOU!

What are the exact error messages you are seeing? Without them it is
impossible to diagnose your problem.

Aaron

Jul 18 '05 #5
mikeSpindler wrote:
I've seen it addressed in searching, but not specifically what is
recommended to get around it. On Linux where I did my development all
was fine. But then going to Solaris for the target I found I couldn't
resolve the errors wrt execvp(). It's apparently not syntax, but I
could be wrong. Any other thoughts on how to get execvp() working
and/or how to cat a file in a new window without bringing tkinter into
the discussion?

My example:
os.system("xterm -geometry 120x20 -e \"tail -f ./logs/DATAFILE\"&")

Thank you!
Mike


Stupid question first: does the command work in a shell? Because AFAIK, there is
no xterm installed by default under Solaris. The terminal is called dtterm and
is located in /usr/dt/bin.

I tried the exact same thing you're doing on Solaris 2.7 with Python 2.1 and got
no error at all:

Python 2.1.1 (#13, Dec 10 2003, 10:31:34)
[GCC 3.2.2] on sunos5
Type "copyright", "credits" or "license" for more information.
import os
os.system('/usr/dt/bin/dtterm -geometry 120x20 -e '

'tail -f /var/log/samba/log.smb &')
0

So I can only repeat what others already told you: please send the exact error
messages you get, or we won't be able to help you much...
--
- Eric Brunel <eric (underscore) brunel (at) despammed (dot) com> -
PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com
Jul 18 '05 #6
On Tue, 19 Oct 2004, mikeSpindler wrote:
You might not be aware - os.system calls execvp. Thus, when I call
os.system I'm getting execvp errors when I run on Solaris. Thank you
for the responses so far. I'd love to hear how to resolve the known
issue of Python not using the system's execvp. THANK YOU!


os.system() calls system() (in Modules/posixmodule.c). How any given
libc implements system() is a vendor issue, but it doesn't surprise me
that it would use execvp().

Without the exact error message, as other replies have also requested,
we're no wiser.

I also don't comprehend your assertion about there being a known issue of
Python not using the system's execvp(). If your gripe is that Lib/os.py
implements os.execvp() in terms of execv()/execve(), then information
about why you believe that is a problem would also be appreciated.

-------------------------------------------------------------------------
Andrew I MacIntyre "These thoughts are mine alone..."
E-mail: an*****@bullseye.apana.org.au (pref) | Snail: PO Box 370
an*****@pcug.org.au (alt) | Belconnen ACT 2616
Web: http://www.andymac.org/ | Australia
Jul 18 '05 #7
>>>>> mi**@spindler.us (mikeSpindler) (m) wrote:

m> I've seen it addressed in searching, but not specifically what is
m> recommended to get around it. On Linux where I did my development all
m> was fine. But then going to Solaris for the target I found I couldn't
m> resolve the errors wrt execvp(). It's apparently not syntax, but I
m> could be wrong. Any other thoughts on how to get execvp() working
m> and/or how to cat a file in a new window without bringing tkinter into
m> the discussion?

m> My example:
m> os.system("xterm -geometry 120x20 -e \"tail -f ./logs/DATAFILE\"&")

Leave out the \"'s:
os.system("xterm -geometry 120x20 -e tail -f ./logs/DATAFILE&")
--
Piet van Oostrum <pi**@cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: P.***********@hccnet.nl
Jul 18 '05 #8

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

Similar topics

0
by: Kevin Smith | last post by:
I have a tool that invokes a command on a remote machine using ssh (cygwin) on Windows. Typing the command at a command prompt works fine. I get prompted to verify the host and asked for a...
1
by: s99999999s2003 | last post by:
hi i am using this code to run a ps command in unix def run(program, *args): pid = os.fork() if not pid: os.execvp(program, (program,) + args) return os.wait() run("ps", "-eo...
0
by: mohitp | last post by:
HI I am trying to compile WSDLs on a unix box, it generates the .obj file, but when creating .lib it throws this error execvp: ar: Arg list too long Any pointers to this error? Thanks Mohit
5
by: ws.taylor | last post by:
I am in a systems programming class, using C on a Solaris 10 development server. Part of the first programming assignment calls for the output of a command executed by a child process with execvp...
2
by: noelloen | last post by:
hi, I have the following code, int ret; char ** vector; //vector = "ls" vector ="-al" ..... //fork a child ......
3
by: Thomas Guettler | last post by:
Hi, I noticed, that sys.stout does not get flushed before the process is replaced. The last print statements (before execvp()) disappear. It only happens, if the output is redirected to a file...
1
by: ohaqqi | last post by:
Hi guys, I'm still working on my shell. I'm trying to implement a function typefile that will take a command line input as follows: > type <file1> This command will implement a catenation of...
1
by: vinney143 | last post by:
any inputs with respect toexecvp(e_argv,e_argv) function wll be helpful... i want to know what this function does? is there such a function in C? if possbile, any sample programs will be...
2
by: thanhnh | last post by:
Hi. I have to write a simple Shell with History feature. First, I get a string from command line. The command line is split into tokens. And then, I call fork ( ) to create a new process. The child...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.