Mail Archives: djgpp-workers/2001/10/09/08:23:07
Hello DJGPP workers !
I've uploaded a patch again the CVS code of yesterday that adds the three
Watcom/MinGW/MSVC compatible _findfirst(), _findnext() and _findclose()
functions to the libc, as Eli Zaretskii suggested a few days ago on the
comp.os.msdos.djgpp newsgroup, at the address:
http://www.multimania.com/ebotcazou/dev/djgpp_findfirst.zip
I used the Watcom libc documentation available at http://www.openwatcom.com
as reference for the implementation. There are a few differences though:
- if LFN is Y, time_create and time_access are set,
- the functions use __doserr_to_errno() so that errno is set to ENMFILE (not
ENOENT) when no more matching files are found.
Some remarks:
- the code is very similar to that of src/libc/dos/dir/findfirs.c and
src/libc/dos/dir/findnext.c,
- I've put a __dostime_to_time_t() function in the same file as
_findfirst(). This breaks the 'one function per file' rule but I didn't know
where to put it,
- as hostbin/mkdoc.exe skips underscores in its sorting algorithm, the three
functions are mixed with findfirst() and findnext() in the 'file system'
section of the docs, and that's not very nice.
The zip file also contains a little program (findfile.c) that exercises the
three functions, tested under Win95 OSR2 and MS-DOS 7. Note that the program
compiles unmodified under MinGW.
--
Eric Botcazou
ebotcazou AT multimania DOT com
- Raw text -