A
Alex
Hi all, can someone please show me how to get the size of a file with ANSI
C? both in text mode and binary mode.
thanks in advance.
C? both in text mode and binary mode.
thanks in advance.
Hi all, can someone please show me how to get the size of a file with ANSI
C? both in text mode and binary mode.
Tell us more about this padding in a binary stream. Is there some
picky stream <> file thing here? Note that the OP asked about a file.
those said:there is no way to be certain, since padding is allowed in binary streams
and translations may be occurring for text streams. often the platform
does track a file's size exactly, in which case there is usually a function
available -- but that should be addressed in a group which caters to your
platform and/or implementation.
So the file has two sizes. What the user wanted n, and what he got, m.
And m may be larger than n.
For a file append to work it seems to me that EOF
has to be detected at n and not m. Right? So if he is at EOF he
gets n.
So why can't he use ftell() to see where he is?
BTW, I mentioned the stream - file thing only to minimize the
number of potential messages.
Flash said:In C you use streams to access files. Due to the limitations of some
systems binary streams (or files) are allowed to have padding at the
end. The reason for this being that some file systems only store the
file length to the nearest block.
Alex said:Hi all, can someone please show me how to get the size of a file with ANSI
C? both in text mode and binary mode.
Alex said:Hi all, can someone please show me how to get the size of a file with ANSI
C? both in text mode and binary mode.
thanks in advance.
Hi all, can someone please show me how to get the size of a file with ANSI
C? both in text mode and binary mode.
thanks in advance.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.