Message-ID: <000001be4056$488e4100$11a531ce@fresita-one> From: "Jorge Ivan Meza Martinez" To: Subject: RE: LFN in Win95? How do I do it? Date: Thu, 14 Jan 1999 14:43:12 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Reply-To: djgpp AT delorie DOT com Hello Eli, >> printf("8.3 NAME = %s\n", ffblk.name); >> printf ( "LFN NAME = %s\n", _truename(ffblk.name, NULL) ); > >Did you actually try this? I think it will only work correctly if your >current directory is the same as the one listed by _dos_findfirst/next, >because ffblk.name doesn't include the full path name, only the file name >part. yes, you are right; I hadn't tested it with other directories, then _truename gets (null). The solution is to append the path to the filename before call _truename. #include #include #include struct find_t ffblk; int main ( int argc, char* argv[] ) { char path[256]; char d[MAXDRIVE], p[MAXDIR], f[MAXFILE], e[MAXEXT]; if ( argc < 2 ) { printf ( "dir -- dir \n" ); return ( 1 ); } printf ( "criteria %s\n", argv[1] ); fnsplit(argv[1], d, p, f, e); if ( _dos_findfirst( argv[1], _A_NORMAL | _A_RDONLY | _A_HIDDEN | _A_SYSTEM | _A_VOLID | _A_SUBDIR | _A_ARCH, &ffblk) == 0 ) { printf("%s\n", ffblk.name); while ( _dos_findnext(&ffblk) == 0 ) { sprintf ( path, "%s%s%s", d, p, ffblk.name ); printf ( "8.3 NAME = %s\n", ffblk.name ); printf ( "LFN NAME = %s\n", _truename ( path, NULL ) ); } } return ( 0 ); } But for an unknown reason ( to me ), you have to write the parameter between quots or it doesn't work, it must be something like dire "c:\windows\command\*.*", writting it without \" it only takes the first file. talking about dir programs, I got a dobt. I made this program that write the parameters from command line: #include void main ( int argc, char* argv[] ) { printf ( "c %i\n", argc ); for ( int i=0; i Para: Jorge Ivan Meza Martinez CC: djgpp AT delorie DOT com ; hoskinst AT cadvision DOT com Fecha: Miércoles, 13 de Enero de 1999 05:16 p.m. Asunto: RE: LFN in Win95? How do I do it?