Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <3C59CB7A.6000202@welho.com> Date: Fri, 01 Feb 2002 00:55:54 +0200 From: Sami Tikka User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.7) Gecko/20011221 X-Accept-Language: en-us MIME-Version: 1.0 To: Francis Harvey CC: "'cygwin AT cygwin DOT com'" Subject: Re: GCC and getcwd References: <08B08C9FA5EBD311A2CC009027D5BF81032B0F9E AT remailnt2-re01 DOT westat DOT com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Francis Harvey wrote: > I want to find the current directory that the executable file is in, > so I can open a text file in the same directory. The executable > is on the k drive, but my code doesn't return the correct path: This is not the Unix way to do things. The Unix API does not provide any way for a process to find out where its executable image is located (it might not exist anymore!) See: http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC23 -- Sami Tikka, sti AT iki DOT fi, http://www.iki.fi/sti/ /* No comment */ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/