Re: file size ? (inode->i_size ?)

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

 



Thank you very much indeed it was the wrong file !

On 1/3/07, Avishay Traeger <atraeger@xxxxxxxxxxxxx> wrote:
On Tue, 2007-01-02 at 19:41 +0200, Ramagudi Naziir wrote:
> Hello.
>
> I'm trying to find out the size of an open file.
> I'm doing printk("%d\n",file->f_dentry->d_inode->i_size);
> but i get the number 4585 no matter what is the real size
> of the file (even empty) !
>
> please what is my problem ?

Can you send your code?  As far as I can tell, what you did should work,
but it depends on what "file" is.  Also, make sure that the "4585" that
you see is coming from this specific printk, and you also might want to
print out file->f_dentry->d_name.name at the same time, because maybe
4585 is for a different file.

Avishay



--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux