delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/07/10/15:31:25

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: <5.1.0.14.2.20010710122511.02362e48@pop3.cris.com>
X-Sender: rrschulz AT pop3 DOT cris DOT com
X-Mailer: QUALCOMM Windows Eudora Version 5.1
Date: Tue, 10 Jul 2001 12:30:02 -0700
To: Michael Eager <eager AT eagercon DOT com>, Cygwin <cygwin AT cygwin DOT com>
From: Randall R Schulz <rrschulz AT cris DOT com>
Subject: Re: Error in access() with long file names
Cc: eager AT mvista DOT com
In-Reply-To: <3B4B2FAB.CF780EF5@eagercon.com>
Mime-Version: 1.0

Michael,

You didn't say whether you're using NTFS, but if so, the : at the end might 
be tripping up either Cygwin or, conceivable, Windows. The name you gave 
takes the form of a file stream (and independent sub-file, a kind of 
generalized file "fork" if you're familiar with the Macintosh file 
systems). This is the case owing to the presence of the colon with more 
than one character to its left.

I tend to doubt the slash is allowable after the colon, but I'm not sure.

It's not that I think access() should return true for this name, but just 
that I wanted to point out the possibility that you're hitting something 
relatively obscure. As I said, it's only supported in NTFS, not in FAT file 
systems.

Randall Schulz
Mountain View, CA USA


At 09:39 2001-07-10, Michael Eager wrote:
>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