delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/10/23:15:32

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: getting the contents of a disk drive
Date: Sat, 10 Jan 1998 23:07:20 -0500
Organization: Two pounds of chaos and a pinch of salt.
Lines: 32
Message-ID: <34B84575.43EB@cs.com>
References: <34B82E90 DOT 48F9 AT csinet DOT net>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp215.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Tim Bruning wrote:
> 
> I want my program to read the drive letter , directory , and files on a
> disk
>  and then display the current drive and directory (like windows' open
> and save boxes)
> anyone know of a way to do this ?

Most C compilers include a complete set of functions for reading
directories and file structures.  Look up the following to see what will
work best for you:

getmntent()
opendir()/readdir()/closedir()
access()
stat()
findfirst()/findnext()
__file_tree_walk()
getcwd()/getwd()

In fact, just about all of these and more can be found in "info libc
'functional categories' 'file system functions'".

hth

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "Sin lies only in hurting other      |
|       aka Fighteer I       | people unnecessarily.  All other     |
|   mailto:fighteer AT cs DOT com   | 'sins' are invented nonsense."       |
| http://www.cs.com/fighteer |                 - Lazarus Long       |
---------------------------------------------------------------------

- Raw text -


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