This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Error in access() with long file names
- To: Cygwin <cygwin at cygwin dot com>
- Subject: Error in access() with long file names
- From: Michael Eager <eager at eagercon dot com>
- Date: Tue, 10 Jul 2001 09:39:07 -0700
- CC: eager at mvista dot com
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/