[pmwiki-users] Trouble with .pageindex when too much _new_ data to index (+ sqlite)

Chuck Goldstein cgpmw13 at codingmaniac.com
Sat Jan 31 02:38:10 CST 2015


file_get_contents($ReindexFile) and file_put_contents($ReindexFile) have a  
file name, not a file handle as their arguments. They are opening and  
closing their own file handles, not using your $fp, which, unfortunately,  
is still open when you try to unlink the file. This is allowed in *nix but  
not in Windows.

Since you are not using $fp at all, the following patch fixes the problem:

--- Site.Reindex.php    2015/01/30 11:23:30     1.2
+++ Site.Reindex.php    2015/01/31 08:27:47
@@ -14,15 +14,14 @@

  $PageIndexTime = 60;
-$fp = @fopen($ReindexFile, "r");
-if (!$fp) { // no .pageindex - start from scratch
+if (! file_exists($ReindexFile)) { // no .pageindex - start from scratch
      echo "DEBUG: A<br />\n";
      $pagelist = $WikiDir->ls();

Chuck G.

On Thu, 29 Jan 2015 08:38:53 -0600, Peter Bowers <pbowers at pobox.com> wrote:

> On Thu, Jan 29, 2015 at 3:29 PM, ABClf <languefrancaise at gmail.com> wrote:
>> Warning: unlink(wiki.d/.reindex): Permission denied in
>> D:\xampp3\htdocs\abclf\local\Site.Reindex.php on line 52
> I would be grateful for any hints related to this problem (above). I  
> create
> the file and run fixperms() on it, but when I try to delete it I get this
> permission denied.  My only access to the file is via file_get_contents()
> which is supposed to close the filehandles when it is done.
> I thought that the problem was something specific to my wamp setup on my
> local development platform, but it appears that Gilles is having the same
> problem.
> I'm pretty sure on my system I had permissions set up pretty  
> permissively...
> Any ideas?
> -Peter

Using Opera's mail client: http://www.opera.com/mail/

More information about the pmwiki-users mailing list