delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/22/11:48:47

Date: Thu, 22 Jan 1998 18:47:09 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "S. M. Halloran" <mitch AT duzen DOT com DOT tr>
cc: djgpp AT delorie DOT com
Subject: Re: access() in DJGPP and TC/BC
In-Reply-To: <199801220827.KAA08443@ankara.duzen.com.tr>
Message-ID: <Pine.SUN.3.91.980122184458.1427L-100000@is>
MIME-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019