Re: ftell Issue or Feature

From: Date: Wed, 08 Jun 2011 09:41:11 +0000
Subject: Re: ftell Issue or Feature
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-313463@lists.php.net to get a copy of this message
On 8 June 2011 10:19, Frank Arensmeier <farensmeier@gmail.com> wrote: > 8 jun 2011 kl. 09.09 skrev Christian Grobmeier: > >> The object itself is always the same, for all threads. Every thread >> gets this "Appender" from a kind of a pool. >> >> My guess is, every thread gets some kind of a copy of this object, >> working at it. Once it reaches the method, its members states are not >> reflected into the other stack call. > > I never worked with "log4php", so I am really not sure how "getMaxFileSize" > calculates the log file size. In general, results for functions like PHP's "filesize" > are cached. See e.g. http://php.net/manual/en/function.filesize.php > > Right after the flock call, try to clear the cache with clearstatcache(). > > Maybe that helps. > /frank if((ftell($this->fp) > ($maxFileSize = $this->getMaxFileSize())) && flock($this->fp, LOCK_EX)) { clearstatcache(); if(ftell($this->fp) > $maxFileSize) { $this->rollOver(); } } would be my take. -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

« previous php.general (#313463) next »