X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Trace-PostClient-IP: 68.147.232.190 From: Brian Inglis Newsgroups: comp.os.msdos.djgpp Subject: Re: Finding a program's base directory Organization: Systematic Software Message-ID: <4ahn63dj982mcq5t1le4n7gi280flqrfrn@4ax.com> References: <465ea4ec$0$23146$9b4e6d93 AT newsspool1 DOT arcor-online DOT net> <465EBFC7 DOT 2000400 AT alex3> <465fccd1$0$23146$9b4e6d93 AT newsspool1 DOT arcor-online DOT net> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 33 Date: Sun, 10 Jun 2007 09:41:53 GMT NNTP-Posting-Host: 64.59.135.176 X-Complaints-To: abuse AT shaw DOT ca X-Trace: pd7urf1no 1181468513 64.59.135.176 (Sun, 10 Jun 2007 03:41:53 MDT) NNTP-Posting-Date: Sun, 10 Jun 2007 03:41:53 MDT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Fri, 01 Jun 2007 09:37:58 +0200 in comp.os.msdos.djgpp, Robert Riebisch wrote: >alex bodnaru wrote: > >> looks ok > >Thanks! Anybody else? #include #include #include int main( int argc, char **argv) { char *prog_dir = dirname( *argv ); ... if (!prog_dir) { perror( *argv ); exit( 1 ); } ... free( prog_dir ); ... return( 0 ); } -- Thanks. Take care, Brian Inglis Calgary, Alberta, Canada Brian DOT Inglis AT CSi DOT com (Brian[dot]Inglis{at}SystematicSW[dot]ab[dot]ca) fake address use address above to reply