in reply to lstat for large inode values over 3billion

What operating system? Your kernel is reporting very large integers in the result of stat but some part of the system (either Perl or your C header files) think the inode number in the stat structure is supposed to be signed. ino_t is unsigned under both Solaris and Linux as far as I can tell, maybe you are using something else?

In any case, I think you can force the value to become unsigned without any worries because I don't think anyone has ever heard of negative inode numbers being valid. You found one way to do this: printf with a long integer specifier. I suggest XORing the value with 0. It's a noop but it forces the value to be treated as insigned:

no integer; # you probably don't need this # just pointing out it doesn't work # under use integer; $ino ^= 0;

Replies are listed 'Best First'.
Re^2: lstat for large inode values over 3billion
by cybersekkin (Novice) on Dec 07, 2005 at 19:34 UTC
    XORing it worked :) thanks for the fix.