Mail Archives: djgpp/1998/01/20/15:45:53
From: | "Gary R. Sekinger" <sekinger AT usaor DOT net>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | case of filenames question
|
Date: | Tue, 20 Jan 1998 15:13:36 -0500
|
Organization: | ISPNews http://ispnews.com
|
Lines: | 78
|
Message-ID: | <6a30hn$5e1$1@news4.ispnews.com>
|
NNTP-Posting-Host: | rs8ip224.usaor.net
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
I cannot seem to figure out how to read the lfn filenames. I used opendir()
and readdir(), but the seem to only return lower case versions of the file
names. In the following example, the file "ME" should be uppercase. "ls"
seems to do this as well:
C:\datawh\Utilities>ls -la
total 205
drwxr-xr-x 2 dosuser dos 128 Nov 3 15:26 .
drwxr-xr-x 4 dosuser dos 96 Nov 3 15:26 ..
-rwxr-xr-x 1 dosuser dos 101065 Jan 20 14:33 lcdir
-rw-r--r-- 1 dosuser dos 1754 Jan 20 14:45 lcdir.c
-rwxr-xr-x 1 dosuser dos 103113 Jan 20 14:33 lcdir.exe
-rw-r--r-- 1 dosuser dos 5 Jan 20 14:31 me
C:\datawh\Utilities>dir
Volume in drive C is NOV 03 1997
Volume Serial Number is 2115-16DF
Directory of C:\datawh\Utilities
. <DIR> 11-03-97 3:26p .
.. <DIR> 11-03-97 3:26p ..
LCDIR C 1,754 01-20-98 2:45p lcdir.c
LCDIR 101,065 01-20-98 2:33p lcdir
LCDIR EXE 103,113 01-20-98 2:33p lcdir.exe
ME 5 01-20-98 2:31p ME
4 file(s) 205,937 bytes
2 dir(s) 2,028,101,632 bytes free
C:\datawh\Utilities>more \djgpp\djgpp.env
#= Don't edit this line unless you move djgpp.env outside
#= of the djgpp installation directory. If you do move
#= it, set DJDIR to the directory you installed DJGPP in.
#=
DJDIR=%:/>DJGPP%
+USER=dosuser
+TMPDIR=%DJDIR%/tmp
+EMU387=%DJDIR%/bin/emu387.dxe
+LFN=Y
Here's a sample program and the results:
C:\datawh\Utilities>gcc --version
2.7.2.1
C:\datawh\Utilities>gcc -o filename filename.c
C:\datawh\Utilities>filename
filename: .
filename: ..
filename: lcdir.c
filename: lcdir
filename: FileName.c
filename: lcdir.exe
filename: me
filename: filename
filename: filename.exe
C:\datawh\Utilities>type filename.c
#include <stdio.h>
#include <dirent.h>
#include <string.h>
int main(int argc, char **argv)
{
DIR *d = opendir(".");
struct dirent *de;
while (de = readdir(d))
{
printf("filename: %s\n", de->d_name);
}
closedir(d);
return(1);
}
- Raw text -