Mail Archives: cygwin/2004/03/23/14:48:33
--------------090803090700040704030001
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
> Hi!
>
> I just found a strange problem when using find on a FAT drive.
> I got: "find: .\tmp changed during execution of find"
OK, I analyzed the problem a bit and found that lstat can
give different inode numbers on fat, see the attached testcase.
To test this you have to have a directory called tmp in your
current working directory.
On a FAT drive you get:
$ /tmp/lstat_test.exe
Checking pathname: .\tmp
cur_stat_buf.st_ino: -1375632239
stat_buf.st_ino: 802199907
Error Inode numbers are different!
Bug or feature?
Volker
--
PGP/GPG key (ID: 0x9F8A785D) available from wwwkeys.de.pgp.net
key-fingerprint 550D F17E B082 A3E9 F913 9E53 3D35 C9BA 9F8A 785D
--------------090803090700040704030001
Content-Type: text/plain;
name="lstat_test.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="lstat_test.c"
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
int
main (int argc, char **argv)
{
char pathname[]=".\\tmp";
long a,b;
struct stat stat_buf, cur_stat_buf;
/* get &stat_buf */
lstat (pathname, &stat_buf);
if (chdir (pathname) < 0)
{
printf("Errno: %d Path: %s\n", errno, pathname);
return;
}
/* get &cur_stat_buf. Should be the same as stat_buf. */
if (lstat (".", &cur_stat_buf) != 0)
printf("Errno: %d Path: %s\n", errno, pathname);
/* Use a and b intsead of the variables, otherwise you get strange
results with printf. */
a = cur_stat_buf.st_ino;
b = stat_buf.st_ino;
printf("Checking pathname: %s\ncur_stat_buf.st_ino: %d\nstat_buf.st_ino: %d\n",pathname, a, b );
if (cur_stat_buf.st_dev != stat_buf.st_dev ||
cur_stat_buf.st_ino != stat_buf.st_ino)
printf("Error Inode numbers are different!\n");
}
--------------090803090700040704030001
Content-Type: text/plain; charset=us-ascii
--
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/
--------------090803090700040704030001--
- Raw text -