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.
To chime in here, if you call apr_file_open() on a directory, I have no problem with that being ambiguous/ill-defined. We should just state that in the docs though.
Adding a feature macro doesn't make sense to me since I can't even fathom what you would do with a file-handle representing a directory. About the only thing I could think of would be tweak permissions/ACLs, but those are something we've always decided to punt on since no one can come up with a permissions model that can represent Win32/Unix models. Yet, if we ever had such a beast, I would expect that we'd also allow char*'s to be passed in rather than file handles. -- justin