Message-ID: <01e801c150bc$beb39b40$118824d5@zephyr> From: "Eric Botcazou" To: "DJGPP workers" Subject: _findfirst() patch Date: Tue, 9 Oct 2001 14:19:45 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2014.211 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Reply-To: djgpp-workers AT delorie DOT com 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