Newsgroups: comp.lang.c
From: Greg Martin <g...@softsprocket.com>
Date: Fri, 09 Nov 2012 08:59:20 -0800
Local: Fri, Nov 9 2012 11:59 am
Subject: Re: Strange Behaviour in finding Size of a File
On 12-11-08 11:09 PM, felix wrote:
> 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:
I would think it strange if I knew for sure that the function got called > //-- 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 = 2589116.
> I am not sure if I am missing anything in our understanding of the stat function. Any inputs or pointers on this regard will be really Helpful.
> Thanks in advance, and please let me know if any other information is required.
> --
before the write in every place that the file was possibly being written to and that there weren't multiple process/threads that could write to it. 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.
| ||||||||||||||