Kbase 39178: FILE-INFO:FILE-TYPE does not return the expected file attributes
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
Solution ID: P9178
FACT(s) (Environment):
UNIX
Progress 9.x
SYMPTOM(s):
FILE-INFO:FILE-TYPE does not return the expected file attributes
CAUSE:
Progress relies on the OS function access() to retrieve the file attributes for the given file/directory. An OS bug might prevent access() from returning the correct attributes.
The following C program can be used to demonstrate this:
#include <unistd.h>
main (int argc, char **argv)
{
char buf[3];
char *pbuf, *filname;
if(argc != 2) { return; }
argv++;
filname = *argv;
pbuf = buf;
if(access(filname, R_OK) == 0) { *pbuf++ = 'R'; }
if(access(filname, W_OK) == 0) { *pbuf++ = 'W'; }
*pbuf = '\0';
printf("%s\n", buf);
}
- Compile it.
- Rename a.out to (say) testAccess.
- Change the owner of the executable:
chown root testAccess
- Change the permissions of the executable:
chmod 4755 testAccess
The syntax is:
testAccess [ <file name> | <directory name> ]
The output will show R, W, RW or nothing just like FILE-INFO:FILE-TYPE would.
This program performs the same steps as Progress to report the file attributes; it will report the same "wrong" information as FILE-INFO:FILE-TYPE, and this proves that the problem is in the access() OS function, not in Progress.
FIX:
None.
Please contact your OS vendors to check whether there is a bug, or an incompatibility between the OS function access() and your filesystem configuration.