Argh! I had the whole thing implemented with fopen/fwrite/fclose and when I converted to file_put_contents() apparently I only partially converted.
Thanks! -Peter On Sat, Jan 31, 2015 at 9:38 AM, Chuck Goldstein <[email protected]> wrote: > Peter, > > 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 @@ > > set_time_limit(120); > $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(); > sort($pagelist); > > Chuck G. > > > > On Thu, 29 Jan 2015 08:38:53 -0600, Peter Bowers <[email protected]> > wrote: > > On Thu, Jan 29, 2015 at 3:29 PM, ABClf <[email protected]> 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/ > > > > _______________________________________________ > pmwiki-users mailing list > [email protected] > http://www.pmichaud.com/mailman/listinfo/pmwiki-users >
_______________________________________________ pmwiki-users mailing list [email protected] http://www.pmichaud.com/mailman/listinfo/pmwiki-users
