473,385 Members | 1,429 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,385 software developers and data experts.

setting execv arguments

I am trying to use tiffcp to reconfigure tif files (if they are tiled)
to nontiled so I can use existing code to handle them. However, I am
having issues providing the arguments. The app is run from a temp
directory which has local copy of tiffcp.

///////////////////////////////////////////////////////////////////////////
char *args[] = { "tiffcp", "-p", "contig", "-s", "-r", "1", "-c",
"none", stripe->tif_file_name, dstfile };

if (execv(NULL, args) == -1)
///////////////////////////////////////////////////////////////////////////

What is the proper format?

Thanks,

Douglas
Nov 14 '05 #1
3 1962
In article <8e**************************@posting.google.com >,
Douglas Dillon <do***********@yahoo.ca> wrote:
:I am trying to use tiffcp to reconfigure tif files (if they are tiled)
:to nontiled so I can use existing code to handle them. However, I am
:having issues providing the arguments. The app is run from a temp
:directory which has local copy of tiffcp.

:char *args[] = { "tiffcp", "-p", "contig", "-s", "-r", "1", "-c",
:"none", stripe->tif_file_name, dstfile };

:if (execv(NULL, args) == -1)

execv() is not part of C itself, so this is not covered by the C standard.

:What is the proper format?

I've never seen NULL as the first argument of execv() before.
The first argument should be the path to the executable. If it is in
your current directory, then you would use "./tiffcp" as the path
in your case.
--
Beware of bugs in the above code; I have only proved it correct,
not tried it. -- Donald Knuth
Nov 14 '05 #2
On 12 Mar 2005 09:05:54 -0800, in comp.lang.c , do***********@yahoo.ca (Douglas
Dillon) wrote:
I am trying to use tiffcp to reconfigure tif files
neither this...
if (execv(NULL, args) == -1)
.... nor this....
What is the proper format?


.... is defined by the C standard. Its thus offtopic here, and you'd be better to
ask in comp.unix.programming.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 14 '05 #3
Walter Roberson <ro******@ibd.nrc-cnrc.gc.ca> wrote:
In article <8e**************************@posting.google.com >,
Douglas Dillon <do***********@yahoo.ca> wrote:
:I am trying to use tiffcp to reconfigure tif files (if they are tiled)
:to nontiled so I can use existing code to handle them. However, I am
:having issues providing the arguments. The app is run from a temp
:directory which has local copy of tiffcp. :char *args[] = { "tiffcp", "-p", "contig", "-s", "-r", "1", "-c",
:"none", stripe->tif_file_name, dstfile }; :if (execv(NULL, args) == -1) execv() is not part of C itself, so this is not covered by the C standard.
And thus questions should be asked in e.g. comp.unix.programmer;-)
:What is the proper format? I've never seen NULL as the first argument of execv() before.
The first argument should be the path to the executable. If it is in
your current directory, then you would use "./tiffcp" as the path
in your case.


<OT>
And you need a additional NULL pointer at the end of the 'args' array.
</OT>
Regards, Jens
--
\ Jens Thoms Toerring ___ Je***********@physik.fu-berlin.de
\__________________________ http://www.toerring.de
Nov 14 '05 #4

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

Similar topics

1
by: Mike Vieths | last post by:
I'm running into a problem when I try to run commands with os.execv. It seems to be putting quotation marks around each element of the list passed as its second argument. This is fine for the...
3
by: M Herriott | last post by:
Hello to all - #1: I would have rather used an AND with the choice of newsgroups. I would like to talk to those who subscribe to comp.lang.c++ AND comp.unix.solaris - but I'm stuck with OR....
2
by: New | last post by:
How can I uses a pipe to get the output from a execv() and redirect it to a parent process? in ansi c if possible Thank-you
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
0
by: crazydanwic | last post by:
//runScript.c pid= fork(); if(pid ==0) { error = execv("/usr/local/bin/php", "something.php", (char *)NULL); exit(0); } else { wait(pid); exit(0); }
3
by: martin paul | last post by:
Sir please consider the following.... I would like to copy contents from one file (mart1.c) to another file (mart2.c) using execv() function (using command line arguments)..... The command...
2
by: lgomez8801 | last post by:
lgomez8801 Newbie 1 Posts Today 07:37 PM #1 C language "execv" question --------------------------------------------------------------------------------
3
by: CMorgan | last post by:
Hi everybody, I am experiencing an annoying problem with fork() and execv(). In my program I need to launch the "pppd" from a thread, so, I create a new process with fork and then in the child...
1
by: dudeja.rajat | last post by:
Hi, I'm facing problem with the execv command: my command is : os.execv(' C:\Program Files\Subversion\bin\svn ', ( 'list', ' \" http://subversion.stv.abc.com/svn/Eng \" ' ) ) The error I'm...
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...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.