hi,
i wanted to knoe that how to calculate the total size of file in C?
khot_anuradha
0
Newbie Poster
Recommended Answers
Jump to Postopen the file, seek to end, the get current file position. How to do that depends on C or C++. There are also other ways, such as stat(), win32 api GetFileSize(), and others.
Jump to Post>open the file, seek to end, the get current file position
That's only guaranteed to be meaningful on files opened with a binary orientation. Even then there's a possibility that the size may be inaccurate. The only portable way to determine the working size of a file is to open …
Jump to Post>oThe only portable way to determine the working size of a file is to open the file and read it, from beginning to end.
bullpucky! prove it by example. use of standard library file i/o functions are guarenteed by the language to be portable across platforms that support them. Open …
Jump to Post>use of standard library file i/o functions are guarenteed by the
>language to be portable across platforms that support them.
And conveniently enough the standard clearly states that arbitrary seeking on a text file is undefined.>reading the file from beginning to end in MS-Windows will result
>in incorrect …
All 13 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Narue
5,707
Bad Cop
Team Colleague
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Narue
5,707
Bad Cop
Team Colleague
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Narue
5,707
Bad Cop
Team Colleague
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Narue
5,707
Bad Cop
Team Colleague
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
jim mcnamara
19
Junior Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
jim mcnamara
19
Junior Poster
agiorgio
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.