source: buchla-68k/orig/GEMDOS/DIRNOTES.TXT@ 66b48e7

Last change on this file since 66b48e7 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Imported original source code.

  • Property mode set to 100755
File size: 2.0 KB
Line 
1Netters,
2
3Here are some directory routines I put together awhile back for MS-DOS
4which provide the same functionality as the 4.2 BSD directory routines.
5In this kit you will find scandir(), opendir(), readdir(), seekdir(),
6telldir(), closedir(), etc. They behave like the 4.2 routines with some
7minor exceptions: The actual directory structure is different since
8MS-DOS keeps the equivilent of directory entry and inode in its directory,
9and a picture of the directory is read in during an opendir() call, so if
10something changes in the directory it will not show up in readdir() calls,
11unless you do another opendir().
12
13These routines were written for Microsoft C, though the only special
14functions I used were realloc() and intdos(), which most 'modern' C
15compilers have.
16
17I have also compiled these under all memory models with no problems.
18Microsoft C automatically provides a #define for use in detecting
19which memory model is in use. I use this in scandir() to set up the
20pointers correctly. I also use the FP_SEG and FP_OFF macro's too.
21Other C compilers will have to have this section changed to handle
22their method of splitting far pointers into segments and offsets.
23
24Also included in this kit (Don't send your money now, there's more!)
25are two simple test programs, test1.c and test2.c. These programs
26show how to do a simple directory search, with test1.c using opendir(),
27and test2.c using scandir(). Test2.c also uses another function
28called fmatch(), which I found on the net many months ago in a slightly
29different form. To compile the test programs, use:
30
31 cl test1.c dir.obj scandir.obj
32 cl test2.c fmatch.obj scandir.obj
33
34after compiling dir.c, scandir.c, and fmatch.c.
35
36If you have any comments or bug reports, send them to:
37
38Bill Marsh, Naval Ocean Systems Center, San Diego, CA
39{arpa,mil}net: bmarsh@nosc
40uucp: {ihnp4,akgua,decvax,dcdwest,ucbvax}!sdcsvax!noscvax!bmarsh
41
Note: See TracBrowser for help on using the repository browser.