
Check the file size and number symbols in a file using C in Unix
Quote:
> I would like to ask that is there any command to check the size of
>a file and the number of symbols(character or unprintable symbol) in a
>file?
Not in standard C.
I generally find that reading a file char by char and counting the
number of chars read gives a reasonably accurate measure of the number
of chars in the file.
Quote:
> What is the relationship between file size and number of symbols
>in a file?
Years of experience have taught me that most of the time, the more
things that are in a file, the larger the file tends to be. As a
matter of fact, I don't recall ever adding something to a file and
having it become smaller. Perhaps someone with more math skills than I
could determine the relatonship exactly, but it *does* seem to be
linear. (Perhaps a one-to-one relationship???)
Quote:
--
Cameron Foster
http://www2.netcom.com/~cdfoster/