delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
X-IronPort-AV: | i="3.91,129,1110171600"; d="scan'208"; a="15942191:sNHT14014902950" |
Date: | Mon, 28 Mar 2005 23:36:05 -0500 |
To: | cygwin AT cygwin DOT com |
Subject: | /proc/self/exename -> exe ? (Re: Retrieving name of executable) |
Message-ID: | <20050329043605.GA23477@griboedov> |
References: | <41E811DB DOT 1030800 AT agilent DOT com> <20050114193528 DOT GA8109 AT trixie DOT casa DOT cgf DOT cx> |
Mime-Version: | 1.0 |
In-Reply-To: | <20050114193528.GA8109@trixie.casa.cgf.cx> |
User-Agent: | Mutt/1.5.6i |
From: | Anthony Heading <ajrh AT ajrh DOT net> |
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... ~=> ls -l /proc/$$ total 0 -r--r--r-- 1 ajrh None 0 Mar 28 23:34 cmdline -r--r--r-- 1 ajrh None 0 Mar 28 23:34 ctty lrwxrwxrwx 1 ajrh None 0 Mar 28 23:34 cwd -> /home/ajrh lrwxrwxrwx 1 ajrh None 0 Mar 28 23:34 exe -> /usr/bin/zsh dr-xr-xr-x 2 ajrh None 0 Mar 28 23:33 fd -r--r--r-- 1 ajrh None 0 Mar 28 23:34 gid -r--r--r-- 1 ajrh None 0 Mar 28 23:34 maps -r--r--r-- 1 ajrh None 0 Mar 28 23:34 pgid -r--r--r-- 1 ajrh None 0 Mar 28 23:34 ppid lrwxrwxrwx 1 ajrh None 0 Mar 28 23:34 root -> / -r--r--r-- 1 ajrh None 0 Mar 28 23:34 sid -r--r--r-- 1 ajrh None 0 Mar 28 23:34 stat -r--r--r-- 1 ajrh None 0 Mar 28 23:34 statm -r--r--r-- 1 ajrh None 0 Mar 28 23:34 status -r--r--r-- 1 ajrh None 0 Mar 28 23:34 uid -r--r--r-- 1 ajrh None 0 Mar 28 23:34 winexename -r--r--r-- 1 ajrh None 0 Mar 28 23:34 winpid A -- 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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |