xfs
[Top] [All Lists]

Re: stat() and xfs

To: Ron Henry <dijital1@xxxxxxxxxxxxxx>
Subject: Re: stat() and xfs
From: Nathan Scott <nathans@xxxxxxx>
Date: Wed, 18 Sep 2002 13:19:45 +1000
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <Pine.LNX.4.44.0209162121170.16184-100000@xxxxxxxxxxxxxxxxxxxxx>; from dijital1@xxxxxxxxxxxxxx on Mon, Sep 16, 2002 at 09:29:50PM -0400
References: <Pine.LNX.4.44.0209162121170.16184-100000@xxxxxxxxxxxxxxxxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.2.5i
hi,

On Mon, Sep 16, 2002 at 09:29:50PM -0400, Ron Henry wrote:
> if I do stat("filename", &entry); and I then procede to printf() some of
> the fields of the returned structure, is there a problem with casting the
> elements to int vs something else? for ex should it be
> 
> printf("inode: %d\n", (int)entry.st_ino);  OR
> 
> printf("inode: %lld\n", (long long)entry.st_ino);
> 
> The platform is x86. OS is Linux
> 

The latter is more correct - the first would chop off the top
32 bits (and get the wrong result, should the inode number be
greater than 2^32 - 1).

cheers.

-- 
Nathan


<Prev in Thread] Current Thread [Next in Thread>