delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/11/06/19:26:23

Message-ID: <3462C1F8.59CB@cs.com>
Date: Fri, 07 Nov 1997 07:23:36 +0000
From: "John M. Aldrich" <fighteer AT cs DOT com>
Reply-To: fighteer AT cs DOT com
Organization: Two pounds of chaos and a pinch of salt
MIME-Version: 1.0
To: Randy Maas <randym AT xiotech DOT com>
CC: eliz AT is DOT elta DOT co DOT il, Vik DOT Heyndrickx AT rug DOT ac DOT be, djgpp-workers AT delorie DOT com
Subject: Re: 971009 djsplit & djmerge
References: <3 DOT 0 DOT 1 DOT 32 DOT 19971106105708 DOT 007dd210 AT yacker DOT xiotech DOT com>

Randy Maas wrote:
> 
> >On Thu, 6 Nov 1997, Vik Heyndrickx wrote:
> > fprintf(stderr,"Usage: %s [inputBase] [outputFile]\n", argv[0]);
> >
> >The downside of this is that you (usually) get in argv[0] the whole path
> name of the program, which might be quite long.
> 
> maybe, in a not so elegant fashion, this would do a decent job:

[snip]

Better yet, use fnsplit(), which is what I ended up doing after going to
a lot of trouble to break up filenames manually.

    char progname[FILENAME_MAX];
    fnsplit( argv[0], NULL, NULL, progname, NULL );

    fprintf(stderr,"Usage: %s [inputBase] [outputFile]\n", progname);

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I |     mailto:fighteer AT cs DOT com      |
| Descent 2: The Infinite Abyss - The greatest Internet game of all |
| time just got better!  This time, you're going all the way down...|
---------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019