delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/07/10/12:47:41

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3B4B2FAB.CF780EF5@eagercon.com>
Date: Tue, 10 Jul 2001 09:39:07 -0700
From: Michael Eager <eager AT eagercon DOT com>
X-Mailer: Mozilla 4.76 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Cygwin <cygwin AT cygwin DOT com>
CC: eager AT mvista DOT com
Subject: 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 AT eagercon DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019