Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 12757 invoked from network); 13 Mar 2009 14:34:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Mar 2009 14:34:47 -0000 Received: (qmail 27231 invoked by uid 500); 13 Mar 2009 14:34:47 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 26981 invoked by uid 500); 13 Mar 2009 14:34:46 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 26972 invoked by uid 99); 13 Mar 2009 14:34:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Mar 2009 07:34:46 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [205.178.146.51] (HELO omr1.networksolutionsemail.com) (205.178.146.51) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Mar 2009 14:34:36 +0000 Received: from mail.networksolutionsemail.com (ns-omr1.mgt.netsol.com [10.49.6.64]) by omr1.networksolutionsemail.com (8.13.6/8.13.6) with SMTP id n2DEYEQb032238 for ; Fri, 13 Mar 2009 10:34:14 -0400 Received: (qmail 622 invoked by uid 78); 13 Mar 2009 14:34:14 -0000 Received: from unknown (HELO desktop2) (since@opendemand.com@71.58.218.61) by ns-omr1.lb.hosting.dc2.netsol.com with SMTP; 13 Mar 2009 14:34:14 -0000 Message-ID: Reply-To: "Stephen Ince" From: "Stephen Ince" To: "APR Development" References: <287C165F05B1472492E84E3B725D855F@desktop2> <1404e5910903110916h7a6ae661ya35cf2cd7b979df7@mail.gmail.com> Subject: Re: exec a process. Date: Fri, 13 Mar 2009 10:34:10 -0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Virus-Checked: Checked by ClamAV on apache.org Relative paths do work. You have to use apr_procattr_dir_set. It is relative to the calling process cwd. I need to set cwd directory to be the directory location of the calling process. e.g. If the parent process is /openload/bin/openload.exe. I need to set the directory location to "/openload/bin". In the apr how do you get the directory of the main process? status = apr_procattr_dir_set(attr,directory_location); Steve ----- Original Message ----- From: "Stephen Ince" To: "Eric Covener" ; "APR Development" Sent: Friday, March 13, 2009 9:59 AM Subject: Re: exec a process. >I just one final issue. I can't seem to get relative paths to work for >apr_proc_create. Absolute path works great. > I have also tried using apr_filepath_root to get the canonical but I can't > seem to get it work either. > > I have tried the following. > > exec_name="openload.exe"; > // this fails. openload.exe is actually the program itself (it is in > the same directory). (/openload/bin/openload.exe works ) > exec_path="./openload.exe"; > args[0] = exec_name; > args[1] = url->arg; > args[2] = NULL; > status = apr_proc_create(&newproc, exec_path, args, NULL, attr, pool); > > Is there a way for "apr_proc_create" to use relative paths for an > executeable or get the canonical path for an executeable? > I am testing on win32. Any help would be greatly appreciated. > > Steve > > ----- Original Message ----- > From: "Eric Covener" > To: "APR Development" > Sent: Wednesday, March 11, 2009 12:16 PM > Subject: Re: exec a process. > > >> On Wed, Mar 11, 2009 at 12:08 PM, Stephen Ince >> wrote: >>> Is there a portable way to exec a file within the apr? >>> I noticed that apr_proc_fork is not portable. >>> I basically want to do the following. >>> >>> #setup stdin and stdout. >>> exec("/my file") in a separate process. >>> #wait for the process. >> >> >> apr_procattr_* is available: >> >> http://svn.apache.org/viewvc/apr/apr/trunk/include/apr_thread_proc.h?view=co >> http://svn.apache.org/viewvc/apr/apr/trunk/test/testproc.c?view=co >> >> >> -- >> Eric Covener >> covener@gmail.com >> > >