www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/13/19:30:52

Message-ID: <369D349A.1929C540@cadvision.com>
Date: Wed, 13 Jan 1999 17:04:42 -0700
From: Tim Hoskins <hoskinst AT cadvision DOT com>
Organization: Anarchy Inc.
X-Mailer: Mozilla 4.06 [en] (Win95; U)
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: LFN in Win95? How do I do it?
References: <369D2CB2 DOT 93CCCA2E AT cadvision DOT com>
NNTP-Posting-Host: 207.228.79.137
X-NNTP-Posting-Host: 207.228.79.137
X-Trace: 13 Jan 1999 17:04:49 -0700, 207.228.79.137
Lines: 71
X-NNTP-Posting-Host: 204.50.1.43
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

--------------801D5E12BED9D51D540875EB
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Sorry there, just noticed I posted some old bad code.

Here's the good code:

/* Simple DIR program */

#include <stdio.h>
#include <dos.h>

struct find_t ffblk;

main()
{
 if ( _dos_findfirst("*.*", _A_NORMAL, &ffblk) == 0 )
 {
  printf("%s\n", ffblk.name);
  while ( _dos_findnext(&ffblk) == 0 )
  {
   printf("%s\n", ffblk.name);
  }
 }
}

Please, any information on how to get this code to output long file
names when running off Win95 would be appreciated.

This code should work in just about any compiler, though I'm compiling
it on DJGPP's latest compiler.

Thank You.
Tim Hoskins <hoskinst AT cadvision DOT com>

--------------801D5E12BED9D51D540875EB
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<TT>Sorry there, just noticed I posted some old bad code.</TT><TT></TT>
<P><TT>Here's the good code:</TT><TT></TT>
<P><TT><FONT COLOR="#FF0000">/* Simple DIR program */</FONT></TT><TT><FONT COLOR="#FF0000"></FONT></TT>
<P><TT><FONT COLOR="#FF0000">#include &lt;stdio.h></FONT></TT>
<BR><TT><FONT COLOR="#FF0000">#include &lt;dos.h></FONT></TT><TT><FONT COLOR="#FF0000"></FONT></TT>
<P><TT><FONT COLOR="#FF0000">struct find_t ffblk;</FONT></TT><TT><FONT COLOR="#FF0000"></FONT></TT>
<P><TT><FONT COLOR="#FF0000">main()</FONT></TT>
<BR><TT><FONT COLOR="#FF0000">{</FONT></TT>
<BR><TT><FONT COLOR="#FF0000">&nbsp;if ( _dos_findfirst("*.*", _A_NORMAL,
&amp;ffblk) == 0 )</FONT></TT>
<BR><TT><FONT COLOR="#FF0000">&nbsp;{</FONT></TT>
<BR><TT><FONT COLOR="#FF0000">&nbsp; printf("%s\n", ffblk.name);</FONT></TT>
<BR><TT><FONT COLOR="#FF0000">&nbsp; while ( _dos_findnext(&amp;ffblk)
== 0 )</FONT></TT>
<BR><TT><FONT COLOR="#FF0000">&nbsp; {</FONT></TT>
<BR><TT><FONT COLOR="#FF0000">&nbsp;&nbsp; printf("%s\n", ffblk.name);</FONT></TT>
<BR><TT><FONT COLOR="#FF0000">&nbsp; }</FONT></TT>
<BR><TT><FONT COLOR="#FF0000">&nbsp;}</FONT></TT>
<BR><TT><FONT COLOR="#FF0000">}</FONT></TT><TT></TT>
<P><TT>Please, any information on how to get this code to output long file
names when running off Win95 would be appreciated.</TT><TT></TT>
<P><TT>This code should work in just about any compiler, though I'm compiling
it on DJGPP's latest compiler.</TT><TT></TT>
<P><TT>Thank You.</TT>
<BR><TT>Tim Hoskins &lt;hoskinst AT cadvision DOT com></TT></HTML>

--------------801D5E12BED9D51D540875EB--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019