[comp.os.msdos.programmer] Wanted: Sample program that uses FCBs to wildcard

heintzefmcsse.enet.dec.com (Sieg Heintze) (10/05/90)

    I want to write a program in C that uses wildcarding to display the 
    sizes of all the files in the current directory.

    I typed in a program "find.c" that uses "handles" from Terry Dettmann's
    book "MSDOS  Programmer's reference".  This program successfully
    displayed all the files on the top level directory and recursed down
    thru the directory structures displaying all the files in them.   

    I wrote a second program "filesize.c"  that accepted a file name from
    the command line, called INT 0x21, FUNC 0x29 (parse file name into FCB)
    and finally called INT 0x21, FUNC 0x23 (get file size) and displayed
    the number of bytes used by that one file.

    Both of these programs worked.  I tried modifying the first program
    (find.c) so it would display the size of the file.  I could not make
    INT 0x21 FUNC 0x23 return the correct file size anymore even though I
    did a verbatim cut and past of the function used in "filesize.c".

    Would it be correct to conclude that FCBs and file handles should not 
    coexist in the same program?  

    I tried writing a 3rd program that used FCBs to perform wildcarding but
    I could not make this work.  Can anyone reference me to an example of
    this?  (or, better yet, mail me one?)

            Thanks,

            Sieg


heintze@genral.enet.dec.com
Digital Equipment Corporation
1110 Chapel Hills Drive  CXN2-2/35
Colorado Springs, CO 80920-3995
719-260-2184