Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

definitions again (Developers)

posted by kerravon, Ligao, Free World North, 23.04.2024, 11:50

> #include <io.h>
> _WCRTLINK extern long _findfirst( const char *__filespec,
> struct _finddata_t *__fileinfo );
> _WCRTLINK extern int _findnext( long __handle,
> struct _finddata_t *__fileinfo );[/code]

I was thinking - this burdens the library or OS with
the need to do pattern matching (filespec), and
quite possibly not everyone would agree on which
wildcards to use.

In addition, the library would need to make a decision
on whether to match case or not.

On more thing is that it requires fixed space to be
allocated for the resultant data. If this had been
done right from the start, there would be nowhere to
store a long filename, and not enough space to do
so either.

Would it be more appropriate to simply open a directory -
if you want portability anyway - and then let the
library give you the next entry, so the onus is on it
to provide sufficient space? I believe POSIX has an
opendir() which may provide guidance.

I think long filenames would operate in conjunction with
FILENAME_MAX - if a C90-extended platform suddenly starts
returning long filenames - fine, they should have increased
FILENAME_MAX at the same time, so applications are not
affected at the source code level.

Ultimately my interest is in well-behaved programs at the
source code level. Not binary backward compatibility with
everything from CP/M upwards (not that MSDOS 1.0 did that
anyway).

BFN. Paul.

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 50 users online (0 registered, 50 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum