Newsgroups: comp.lang.c
From: Keith Thompson <ks...@mib.org>
Date: Fri, 09 Nov 2012 11:34:54 -0800
Local: Fri, Nov 9 2012 2:34 pm
Subject: Re: Strange Behaviour in finding Size of a File
felix <ckpra...@gmail.com> writes:
It's been pointed out that 1048576 is the wrong value if you want 10 MB
> This method was written to create new Log File, when the size of the > Log File reaches a max size defined by user [10MB in our case]. Here > is the code snippet that does this check: > //-- Code starts here : --
> static size_t LogSize = 1048576;
> if ( stat ( logFile, &results ) == 0 )
> It is strange that the condition got satisfied when results.st_size =
(more pedantically, 10 MiB). But LogSize is also the wrong type. It should be the same type as the st_size member. You probably want to use "const" rather than "static" in the definition
Neither of these is likely to be the cause of the problem you're seeing.
-- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||