Boost logo

Boost :

From: Kevlin Henney (Kevlin.Henney_at_[hidden])
Date: 2000-01-13 04:55:57

Dietmar Kuehl writes:
>I thought about this stuff too and basically it says that anything with
>an extension might be executable depending on the software the user
>has installed. As a consequence, I don't think that it makes much sense
>to provide access to an executable flag in the way I have done so far.
>Unless somebody knows a suitable system call determining whether
>a file is executable, I will drop support for this flag for Win32

My concern with this is that it creates different interfaces for different
platforms: shouldn't Boost interfaces be stable? It is one thing to
conditionally exclude compilation of parts of a class interface because of
compiler limitations -- the trend being that these will become redundant
with the move toward standard compilers. It is quite another to compile out
core features based on platform, where a trend towards one platform or
another is more of a political than a standard's issue.

I do not see anything wrong with just using the executable info found in
struct stat consistently across all platforms that support it (which
includes Win32), and let the context provide the meaning. This defaulting
or simple wrappering is normally how such issues are dealt with, ensuring a
consistent interface always provided.

If the default provided by stat et al is not acceptable, the choice for
handling executablility seems to be one of the following:

   /1/ Either always return true (as per MKS) or always return false, and
   the set operation can either always succeed or always fail.

   /2/ The get can do something intelligent (ie lookup PATHEXT or use a
   hardwired set of possibilities), and the set can always fail/succeed
   depending on what it was already.

In this light, directories could be interpreted differently:
executable/searchable would mean that they were not hidden. Alternatively,
whatever rule is adopted for regular files could also be applied to

If I were writing a version of ls and wished to use the library, the
previous version would have allowed me to write it in a platform
independent manner, nary a #if in sight; a newer version w/o executable
info would push conditional compilation into my code.

Just my GBP0.02.


Boost list run by bdawes at, gregod at, cpdaniel at, john at