Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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.20010710151436.02adfa10@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 15:16:31 -0700 To: Corinna Vinschen , Cygwin From: Randall R Schulz Subject: Re: Error in access() with long file names In-Reply-To: <20010710225812.Z8578@cygbert.vinschen.de> References: <3B4B6398 DOT B524F174 AT mvista DOT com> <5 DOT 1 DOT 0 DOT 14 DOT 2 DOT 20010710122511 DOT 02362e48 AT pop3 DOT cris DOT com> <3B4B6398 DOT B524F174 AT mvista DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Corinna, The question remains, shouldn't the response from the access() call indicate that the named file is not readble (or accessible in any way), since in fact it is not? Randall Schulz At 13:58 2001-07-10, Corinna Vinschen wrote: >On Tue, Jul 10, 2001 at 01:20:40PM -0700, Michael Eager wrote: > > One of the systems that I've checked has both FAT32 and NTFS drives. > > The problem occurs when referencing either drive, either by default > > (i.e., cd to a directory on the drive), or explicitly. > >That's not the problem. It's definitely the usage of the colon and >the slash which are not allowed in filenames other than as drive/stream >separator resp. path separator. This is documented in MSDN as well. >And it actually already leads to confusion in Cygwin. > >Corinna > > > Randall R Schulz wrote: > > > > > > 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 > > > >#include > > > > > > > >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 > > > > -- > > Michael Eager eager AT mvista DOT com 408-328-8426 > > MontaVista Software, Inc. 1237 E. Arques Ave., Sunnyvale, CA 94085 > >-- >Corinna Vinschen Please, send mails regarding Cygwin to >Cygwin Developer mailto:cygwin AT cygwin DOT com >Red Hat, Inc. -- 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/