This is the mail archive of the
mailing list for the Cygwin project.
GCC and getcwd
- From: Francis Harvey <HARVEYF1 at WESTAT dot com>
- To: "'cygwin at cygwin dot com'" <cygwin at cygwin dot com>
- Date: Thu, 31 Jan 2002 13:21:29 -0500
- Subject: GCC and getcwd
This isn't directly a cygwin question, but hopefully somebody has a
suggestion or a new topic I should search on:
I have a working C program created with GCC 2.95.2-6 and Cygwin
dll 1.1.7. I realize both of these are a little old, but I think
I have a conceptual problem rather than a version issue.
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:
/* Begin code sample */
int size = 100;
testfile = fopen("c:\\windows\\desktop\\test.txt","w");
fprintf(testfile,"buffer = %s\n",buffer);
/* End code sample */
buffer = /cygdrive/c/WINDOWS/DESKTOP
I am probably using the wrong function or possibly need to look
at a Windows-based group of functions?
TIA for any ideas.
Francis R. Harvey III
VB programmers know the wisdom of Nothing
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html