Re: [xml] Don't read XML from directories.

Date view Thread view Subject view Author view

From: Peter Jacobi (pj@walter-graphtek.com)
Date: Tue Jan 23 2001 - 05:40:22 EST


Hi Daniel, All,

>
> I have no problem adding this check (patch welcome !), my only concern
> is about portability of the check (on Windows for example). Is S_ISDIR()
> part of the Posix definition (I think so) and does it work on Windows ?
>

IMHO the IS_DIR macro is not posix, but the constant IF_DIR is.
So, if undefined, S_IFDIR can be defined.

#define S_ISDIR( m ) (((m) & S_IFMT) == S_IFDIR)

Then there is a small complication, as stat and S_IFDIR are Posix, but
don't conform to ANSI/ISO naming conventions. So they are sometimes
called _stat and _S_IFDIR, which can easily corrected by macros.

stat and S_IFDIR are available with Watcom on all platforms.

_stat and _S_IFDIR are available since MSVC4 on Windows (MSVC
users please check, to be sure)

stat and S_IFDIR are available with CodeWarrior on WIN32, Mac and
BeOS.

Regards,
Peter Jacobi

----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Jan 23 2001 - 06:43:39 EST