This is the mail archive of the cygwin 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]
Other format: [Raw text]

RE: Possible bug in stat, lstat with long filenames or paths


$ uname -a
CYGWIN_NT-5.0 P450 1.5.10s(0.114/4/2) 20040420 11:21:06 i686 unknown unknown
Cygwin

This is: Win2K advanced server, SP4+all updates, cygwin w most (but no all)
recent updates and the 2004-04-20 snapshot dll.

$ cat stat.c
#include <string.h>
#include <stdio.h>
#include <sys/stat.h>

int main()
{
    char filename[1024];
    struct stat sb;

    strcpy(filename, "a");
    while(strlen(filename) < 1023)
    {
        strcat(filename, "a");
        printf("filename length %d\n", strlen(filename));

#ifdef DOSTAT
        stat(filename, &sb);
#endif

    }
    return 0;
}
$ gcc -DDOSTAT -o stat stat.c && stat >stat-run
$ gcc -o stat stat.c && stat >stat-chk
$ diff -u0 stat-*
$ ls -l stat-*
-rw-r--r--    1 Hannu       20358 May  5 21:36 stat-chk
-rw-r--r--    1 Hannu       20358 May  5 21:36 stat-run


Looks to me like you might have a fix in trying some of the snapshot dll's.
Test run on 8GB FAT32 and NTFS partitions, no diff.
<cygcheck output not checked>


/Hannu E K Nevalainen, B.Sc. EE - 59+16.37'N, 17+12.60'E

** on a mailing list; please keep replies on that particular list **

-- printf("LocalTime: UTC+%02d\n",(DST)? 2:1); --
--END OF MESSAGE--


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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]