This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Error in access() with long file names


Using the most recent version of Cygwin. 

The access function return success when given a long string argument
which does not represent a valid file.  There is some sensitivity to the 
characters in the string.  Removing the colon (and perhaps some other
characters) in the example program below gives correct results.

Anyone know of a fix?

===================================

#include <stdio.h>
#include <unistd.h>

char name[] =
 "aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffgggggggggghhh"
 "hhhhhhhiiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllmmmmmmmmmmnnnnnnnnnnooooo"
 "oooooppppppppppqqqqqqqqqqrrrrrrrrrrssssssssssttttttttttuuuuuuuuuuvvvvvvvv"
 "vvwwwwwwwwwwxxxxxxxxxxyyyyyyyyyyzzzzzzzzzz01234567890:/";

int main()
{
  if (access (name, R_OK) == 0) 
    printf ("%s is readable\n", name);
  else
    printf ("%s is NOT readable\n", name); 
 
  return 0;
}


-- 
Michael Eager	 Eager Consulting     eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]