From david@cs.uow.edu.au Thu Dec 3 18:59:54 1992 Received: from calvin.sfasu.edu by umaxc.weeg.uiowa.edu (5.61.jnf/920629) on Thu, 3 Dec 92 18:59:52 -0600 id AA17618 with SMTP Received: from wraith.cs.uow.edu.au by calvin.sfasu.EDU with SMTP (5.59/25-eef) id AA06566; Thu, 3 Dec 92 18:50:43 CST Return-Path: Received: by wraith.cs.uow.edu.au (5.65c/IDA-1.4.4); id AA20236; Fri, 4 Dec 1992 11:48:08 +1100 (from david@cs.uow.edu.au for hyperC-l@calvin.sfasu.edu) From: David E A Wilson Message-Id: <199212040048.AA20236@wraith.cs.uow.edu.au> Subject: findfirst & findnext (fwd) To: hyperC-l@calvin.sfasu.edu (Hyper C Mailing List) Date: Fri, 4 Dec 92 11:48:07 EST Status: R > Microsoft C and Turbo C (maybe eUnoch too ;-)) have these two > functions to read a directory and compare each filename therein > to a filespec. Has anyone written anything like this for > HyperC? I think I have something written in assembly that > could be modified to provide the functionality ... after I > determine what all the parms are (wannabe or appear to be > standard). I just don't want to re-invent the wheel. I personally would prefer to see the UNIX style opendir/readdir/closedir interface. #include DIR *opendir(dirname) char *dirname; struct dirent *readdir(dirp) DIR *dirp; long telldir(dirp) DIR *dirp; void seekdir(dirp, loc) DIR *dirp; long loc; void rewinddir(dirp) DIR *dirp; int closedir(dirp) DIR *dirp; Under ProDOS they should not be very difficult at all to write. I might have a go myself. dirent.h defines the above routine types in terms of: /* * Definitions for library routines operating on directories. */ typedef struct __dirdesc { int dd_fd; /* file descriptor */ long dd_loc; /* buf offset of entry from last readddir() */ long dd_size; /* amount of valid data in buffer */ long dd_bsize; /* amount of entries read at a time */ long dd_off; /* Current offset in dir (for telldir) */ char *dd_buf; /* directory data buffer */ } DIR; -- David Wilson +61 42 213802 voice, +61 42 213262 fax Dept Comp Sci, Uni of Wollongong david@cs.uow.edu.au