Mail Archives: djgpp/1998/01/22/11:48:47
On Thu, 22 Jan 1998, S. M. Halloran wrote:
> This is a C language fundamental that you bring up. Constants should
> never really be used in the code and should really be defined by
> macros for the purpose of portability. If you always use the macro
> symbols for constants for functions in the standard library (or
> functions with well-understood portability), you should never have a
> problem getting the code to work on different implementations. It is
> a very rare case that numeric constants, rather than their symbolic
> macros, would ever be used directly in the code.
Unfortunately, this advice is useless in the case of `access', since some
systems (TC is one of them, but there are others, even on Unix) don't
define the R_OK, W_OK etc. symbols for the mode argument of `access'. On
those systems, you *must* use numeric values if you call `access'.
That's why I advise to avoid using this function.
- Raw text -