gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] tla1.2 on cygwin -> FAT partition


From: lode . leroy
Subject: Re: [Gnu-arch-users] tla1.2 on cygwin -> FAT partition
Date: Fri, 5 Mar 2004 11:25:38 +0100 (CET)
User-agent: SquirrelMail/1.4.1

> address@hidden wrote:
>
>>The only problem for using it on FAT is that tla depends on "inode"
>>values, and FAT does not have them, NTFS does have a similar thing.
>>
>>
> I've just had a quick glance at the Linux vfat docs.  Apparently
> directory entries have an entry for the start cluster number, which is a
> 16-bit integer.  It wouldn't surprise me at all if that's what Linux
> uses for the inode.  Is that available?
>
> Aaron
>

Here is a small program to print out the "inode" number
returned by cygwin.

#include <sys/stat.h>

main(int argc, char* argv[])
{
  char* path;
  struct stat buf;
  int err;

  path = argv[1];
  err = stat(path, &buf);
  if (err != 0) {
    perror("stat failed");
  } else {
    printf("ino=%u\n", buf.st_ino);
  }
}



let's see what happens:
cd /cygwin/ntfs-partition
$ touch t
$ inode t
ino=45060
$ mv t x
$ inode x
ino=45060

cd /cygwin/fat-partition
$ touch t
$ inode t
ino=3633626
$ mv t x
$ inode x
ino=3633630

Cygwin does return an inode (I thought it didn't, but it might have been
added recently, because I update cygwin from time to time).
It looks like they're using the same trick as linux.

(That makes me wonder: does tla work on a VFAT partition
that is mounted on a linux machine? Could someone try this out?)

Now, the issue is that tla uses the inode value to detect that a file
was renamed. Same inode number == same file. This logic fails
on FAT partitions.

-- lode



----------------------------------------------------------------------------------
Plaats je zoekertjes GRATIS op AdValvas
Placez votre petite annonce GRATUITEMENT sur AdValvas
http://www.advalvas.be




reply via email to

[Prev in Thread] Current Thread [Next in Thread]