Subject: Re: bug in find
From: [email-masked] (Tim Newsham)

24 Jan 1997 00:01:35 -0800
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Original-To: [email-masked] (Tim Newsham)
Original-Cc: [email-masked]
In-Reply-To: <[email-masked]> from "Tim Newsham" at Jan 22, 97 09:04:22 am
X-Mailer: ELM [version 2.4 PL24 PGP3 *ALPHA*]
Original-Sender: [email-masked]

> uname -a:
>   CYGWIN32/NT OMEGA 4.0 17.3 i686
> 
> It looks like find has a bug.  Consider the following:
> 
>   windows$ find -name '*.c' >& out; cat out
>   find: ./out: Permission denied
> 
> The find command has trouble with open files it seems.

I've narrowed the problem down some more.  It seems
that lstat() cannot stat an open file.  Test case:
    
    #include <sys/types.h>
    #include <sys/stat.h>

    main()
    {
        int res;
        struct stat buf;

        res = lstat("./file", &buf);
        if(res == -1)
            perror("stat");
        printf("done\n");
    }

    % gcc test.c
    % a.out
    done
    % a.out >& file
    % cat file
    stat: Permission denied
    done
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".