Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Tue, 29 Mar 2005 10:36:37 +0200
From: Corinna Vinschen <corinna@vinschen.de>
To: cygwin@cygwin.com
Subject: Re: /proc/self/exename -> exe ? (Re: Retrieving name of executable)
Message-ID: <20050329083637.GG23860@cygbert.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <41E811DB.1030800@agilent.com> <20050114193528.GA8109@trixie.casa.cgf.cx> <20050329043605.GA23477@griboedov>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050329043605.GA23477@griboedov>
User-Agent: Mutt/1.4.2i

On Mar 28 23:36, Anthony Heading wrote:
> On Fri, Jan 14, 2005 at 02:35:28PM -0500, Christopher Faylor wrote:
> > On Fri, Jan 14, 2005 at 10:39:23AM -0800, Earl Chew wrote:
> > >I think the name of the current executable is stored in myself->progname
> > >within cygwin1.dll.
> > >
> > >The more easily accessible __progname returns the basename of the
> > >executable.
> > >
> > >Is there a way for an application to obtain myself->program, other
> > >than resorting to raw win32 call to GetModuleFileName()?
> > 
> > argv[0] or __argv[0] or /proc/self/exename
> 
> Has this link been renamed?  It appears to have changed to
> /proc/self/exe now, which has broken a lot of my programs...

The old exename was a file containing the path, the new exe is a symlink
pointing to the binary.  This is how it's done on Linux.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

