Coder's Guild Mailing List

Re: executing programs from C/C++ code

Posted by Morgan Terry on 1999-08-23

use $HOME instead of ~.  For example, intead of:
	 system("~/bin/app");
do this:
	system("$HOME/bin/app);

Frank Hale wrote:
> 
> Problem: I need to execute programs and there path has
> a ~ (home directory) in it. For example:
> 
> ~/bin/app
> 
> Say I want to execute that app. How do I do it so that
> the routine will convert the ~ into my home directory?
> 
> I am currently using the C routing system(). But this
> doesn't convert it.
> 
> Any suggestions?
> 
> Frank
> 
> ===
> From: Frank Hale
> ICQ: 7205161
> Webpage: http://jade.netpedia.net/sapphire
> Webpage: http://www.linuxstart.com/~frankhale
> 
> "Sapphire - a new window manager for X11"
> __________________________________________________
> Do You Yahoo!?
> Bid and sell for free at http://auctions.yahoo.com
> 
> > 

-- 
Morgan
morgan@xxxxxxxxxxx.xxx