<div dir="ltr">Argh! I had the whole thing implemented with fopen/fwrite/fclose and when I converted to file_put_contents() apparently I only partially converted.<div><br></div><div>Thanks!</div><div><br></div><div>-Peter</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jan 31, 2015 at 9:38 AM, Chuck Goldstein <span dir="ltr"><<a href="mailto:cgpmw13@codingmaniac.com" target="_blank">cgpmw13@codingmaniac.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Peter,<br>
<br>
file_get_contents($<u></u>ReindexFile) and file_put_contents($<u></u>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.<br>
<br>
Since you are not using $fp at all, the following patch fixes the problem:<br>
<br>
--- Site.Reindex.php    2015/01/30 11:23:30     1.2<br>
+++ Site.Reindex.php    2015/01/31 08:27:47<br>
@@ -14,15 +14,14 @@<br>
<br>
 set_time_limit(120);<br>
 $PageIndexTime = 60;<br>
-$fp = @fopen($ReindexFile, "r");<br>
-if (!$fp) { // no .pageindex - start from scratch<br>
+if (! file_exists($ReindexFile)) { // no .pageindex - start from scratch<span class=""><br>
     echo "DEBUG: A<br />\n";<br>
     $pagelist = $WikiDir->ls();<br>
     sort($pagelist);<br>
<br></span>
Chuck G.<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On Thu, 29 Jan 2015 08:38:53 -0600, Peter Bowers <<a href="mailto:pbowers@pobox.com" target="_blank">pbowers@pobox.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Thu, Jan 29, 2015 at 3:29 PM, ABClf <<a href="mailto:languefrancaise@gmail.com" target="_blank">languefrancaise@gmail.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Warning: unlink(wiki.d/.reindex): Permission denied in<br>
D:\xampp3\htdocs\abclf\local\<u></u>Site.Reindex.php on line 52<br>
</blockquote>
<br>
<br>
I would be grateful for any hints related to this problem (above). I create<br>
the file and run fixperms() on it, but when I try to delete it I get this<br>
permission denied.  My only access to the file is via file_get_contents()<br>
which is supposed to close the filehandles when it is done.<br>
<br>
I thought that the problem was something specific to my wamp setup on my<br>
local development platform, but it appears that Gilles is having the same<br>
problem.<br>
<br>
I'm pretty sure on my system I had permissions set up pretty permissively...<br>
<br>
Any ideas?<br>
<br>
-Peter<br>
</blockquote>
<br>
<br></div></div><span class="HOEnZb"><font color="#888888">
-- <br>
Using Opera's mail client: <a href="http://www.opera.com/mail/" target="_blank">http://www.opera.com/mail/</a></font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
______________________________<u></u>_________________<br>
pmwiki-users mailing list<br>
<a href="mailto:pmwiki-users@pmichaud.com" target="_blank">pmwiki-users@pmichaud.com</a><br>
<a href="http://www.pmichaud.com/mailman/listinfo/pmwiki-users" target="_blank">http://www.pmichaud.com/<u></u>mailman/listinfo/pmwiki-users</a><br>
</div></div></blockquote></div><br></div>