Re: Finding size of a file from a program

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

 




read the man page for stat.

man 2 stat

There is a field in the stat structure called st_size.

Hemen Kiran Kapadia
Tata Consultancy Services
Mailto: hemen.kapadia@xxxxxxx
Website: http://www.tcs.com



"Pharaoh ." <pharaoh137@xxxxxxxxx>
Sent by: kernelnewbies-bounce@xxxxxxxxxxxx

01/19/2007 12:49 PM

To
kernelnewbies@xxxxxxxxxxxx
cc
Subject
Finding size of a file from a program





Hi
How to find size of a file from a userspace program without using shell commmands with system() etc?
I want to allocate a buffer and read the entire contents of a file, I know this is not good for large files, but I am just
experimenting with small file currently so this is good enough. Is there any system call available for this?







ForwardSourceID:NT00007516    
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you



[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