[Proj] NADCON, et al.

Gerald I. Evenden geraldi.evenden at gmail.com
Sat Jun 13 15:12:53 PDT 2009


On Saturday 13 June 2009 4:11:57 pm Glynn Clements wrote:
> Gerald I. Evenden wrote:
> > The following is something that should work on Linux and probably BSD,
> > Unix but I have *no idea* if it will work on any of the Microsoft
> > compilers.  If anyone is so inclined could you compile and test the
> > following.
>
> MSVC doesn't have readdir().

That figures.  Small wonder I have so much respect for M$.

> MinGW has readdir(), but the d_type field isn't present.

Of course d_type is a critical element.

> POSIX only specifies d_name; d_type originates from BSD, and isn't
> generally found on SysV-derived Unices. Even on Linux, only some
> filesystems support it.
>
> If you want better portability at the expense of performance, use
> stat() rather than the d_type field.

It seems that stat(2) may also have system dependencies, for example does 
st_mode provide S_ISREG indication.

If one ignores M$, would opendir, readdir (just to get file names) and stat(2) 
be a more reasonable route?

The most critical element with this basic method is to get the damn file 
names.  Otherwise a preoperation with a shell program of some sort and an 
ancillary program is required to create a special file.

Probably could get by without mode detection and just open the file and scream 
if it doesn't open or read properly.

OK, let's just worry about opendir and readdir and do the rest by brute force.

Thanks for your comments.

-- 
The whole religious complexion of the modern world is due
to the absence from Jerusalem of a lunatic asylum.
-- Havelock Ellis (1859-1939) British psychologist



More information about the Proj mailing list