chmod_1, chmod_2, chmod_3 and lrshift_1

Paul Thomas paulthomas2@wanadoo.fr
Sat Aug 5 16:22:00 GMT 2006


François-Xavier,

> 8/msg00105.html
>
> I don't understand exactly why it would make it fail for you and still
> work for me, but could you try it anyway, to see if it fixes the
> problem?
>
That's not the difficulty, although I tried it.

I have been testing:

#include "/svn/gcc-4.2/build/gcc/config.h"
#include <errno.h>
#include <string.h>
#include <unistd.h>

int
my_access_ (char *name, int *m, int name_len)
{
  char * file;
  int i;

  /* Trim trailing spaces from NAME argument.  */
  while (name_len > 0 && name[name_len - 1] == ' ')
    name_len--;

  /* Make a null terminated copy of the string.  */
  file = (char*)malloc (name_len + 1);
  memcpy (file, name, name_len);
  file[name_len] = '\0';

  /* And make the call to access().  */
  return (access (file, *m) == 0 ? 0 : errno);
}

and feeding it with m = 0, 1, 2, 4

It behaves in the same way as your library function and returns 0 no 
matter how the read and write access is set.  Execute (m = 1) also 
behaves in the same way.

Cheers

Paul



More information about the Fortran mailing list