[Ilugc] uniquely identify a file

  • From: prashmohan@xxxxxxxxx (Prashanth Mohan)
  • Date: Fri Feb 16 15:41:31 2007

Natarajan K wrote:

On 2/15/07, Prashanth Mohan <prashmohan@xxxxxxxxx> wrote:

Is there a way to uniquely identify this file? Doing a checksum on the
image file is not feasible given the size of the image. Also, uuidgen
seems to generate different values each time.

Damn! uuidgen is SUPPOSED to produce a unique id each time. My fault. I 
meant to refer to vol_id.

Uniquely identify a file?  You want to uniquely identify against what
collection of objects?  If it is only the filesystem on which the file
resides then the inode number should suffice.  You might need to
provide more details as to what 'uniquely identify' means.

Well, my situation is like this. I maintain an SQL table each for a set 
of files (formatted as File Systems). I formatted it as ext2, and I 
tried to read the UUID value of the FS from it's superblock using the 
ext2fslib (fs->super->s_uuid) which is a 128 bit value. When i printed 
it character by character, it showed non-ASCII values (???2?IN??-??1S). 
Whereas vol_id usually prints ASCII characters. vol_id seems to require 
root permissions.

Is there any other way to uniquely identify files formatted as file systems?

Thanks,

-- 
Prashanth Mohan
http://prashblog.com

Other related posts: