apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Fogel <kfo...@newton.ch.collab.net>
Subject Re: cvs commit: apr/test testfile.c
Date Thu, 02 Jan 2003 17:22:47 GMT
"William A. Rowe, Jr." <wrowe@apache.org> writes:
> Apparently this mental exercise didn't have the effects I had hoped.
> Jeff's patch is correct; it isn't APR's job to determine if one can 'open'
> a directory as a file.  Opening a directory as a file isn't portable, no,
> but we can't "help" the programmer on every possible portability issue.

I thought Ryan's suggestion of an APR_FILE_OPEN_DIR feature macro was
a good one, though.  The idea is that, while APR can't make inherently
non-portable things portable, it *can* at least offer an automated
process by which non-portabilities can be discovered.

That way, someone could write two branches into their code: one to
open dirs as files where possible, the other to do "something else"
where it's not possible.  With the appropriate conditional structure
is in place, they don't have to worry about it anymore.

But the test-and-rewrite method alone...

> When the offending code is moved to Win32, yes that will fail.  And
> then the porter will need to troubleshoot their code, see that they
> are trying to 'open' all files *and* sub-directories, and they will
> have to modify their code.  That's the breaks, we have to draw some
> line between enabling portability and enforcing portability.  That
> line is somewhere about the point that APR stops performing
> adequately.

... isn't sufficient without the feature macro, because once they make
the discovery, their only choice is to remove the code, even though it
might be useful on platforms where it works at all.

So I don't think Ryan's being crazy here.  If he can add the feature
macro, and then reinstate the test (but conditionalized to be a no-op
without the macro), then we'll have the best of all possible worlds.

Which means that XFAIL wouldn't be necessary at all, in this case, I
guess.

-Karl

Mime
View raw message