Mail Archives: djgpp/2000/12/12/19:48:11
> ...
>
> Why is it important what does the shell prompt display? What's
> important is what do library functions such as `getcwd' report. Can
> you check what does `getcwd' return when you have ntlfn loaded?
I wrote a trivial program which prints the result of getcwd(), built with MS
Dev Studio 6.0, and added it to the previous example. The first call returns
the long directory path as expected; the call after "ls.exe" returns the
short form:
E:\Program Files > E:\gjs\C\Experiments\getcwd\Debug\getcwd.exe
getcwd = 'E:\Program Files'
E:\Program Files > E:\gjs\gnu\bin\ls
AverStar Microsoft Visual Studio seti
Java RadView
Jikes Visigenic
E:\PROGRA~1 > E:\gjs\C\Experiments\getcwd\Debug\getcwd.exe
getcwd = 'E:\PROGRA~1'
> > After this, programs which read the current directory name can go
> > wrong. For example, a licensed CM program which gets the current
> > directory name and looks that up in a database fails, because the
> > database lists the long filename format.
>
> If this indeed happens, it might be a bug in ntlfn, so please provide
> a short test program which exhibits the problem.
Here's the trivial source code:
#include <stdio.h>
#include <direct.h>
int main(int argc, char* argv[])
{
char buffer[101];
if (getcwd(buffer, 100) != NULL) {
printf("getcwd = '%s'\n", buffer);
return 0;
} else {
printf("getcwd failed\n");
return 1;
}
}
The executable is available at http://www.averstar.com/~gjs/tmp/getcwd.exe.
> > Are 32-bit executable versions of the v2gnu programs available?
> The FAQ has a pointer to the Cygwin ports in section 3.6.
Thanks for the pointer.
-- George Snyder
- Raw text -