The call to access was coded in absolutes like access(filename, 0) for F_OK and access(filename, 2) for W_OK (write access). I altered the constants to use the designated constants from unistd.h. The same definitions occur in fcntl.h (no differences). The include file unistd.h shows:
#define R_OK 4 /* Test for read permission. */#define W_OK 2 /* Test for write permission. */#define X_OK 1 /* Test for execute permission. */#define F_OK 0 /* Test for existence. */
Using the defines makes reading the source code simpeler. The man page warns that it uses the real id in stead of the effective id. For future consideration.
P.S. Alessandro, I will just merge this with experimental. That way we have quick updates, but still traceability.
The call to access was coded in absolutes like
access(filename, 0)
for F_OK andaccess(filename, 2)
for W_OK (write access). I altered the constants to use the designated constants from unistd.h. The same definitions occur in fcntl.h (no differences). The include file unistd.h shows:Using the defines makes reading the source code simpeler. The man page warns that it uses the real id in stead of the effective id. For future consideration.
P.S. Alessandro, I will just merge this with experimental. That way we have quick updates, but still traceability.