<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
    <title>Magento Issue Tracking</title>
    <link>http://www.magentocommerce.com/bug-tracking/</link>
    <description></description>
    <dc:language>en</dc:language>
    <dc:creator>MagentoCommerce</dc:creator>
    <dc:rights>Copyright {gmt_date format="%Y"}</dc:rights>
    <dc:date>{gmt_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
    <admin:generatorAgent rdf:resource="http://expressionengine.com/" />
        <item>
        <title>View Issue #8992 / Mage_Sitemap / Varien_Io_File Bug - Destination no</title>
        <link>http://www.magentocommerce.com/bug-tracking/issue?issue=4252</link>
        <description><![CDATA[<strong>Posted:</strong> 2008-11-28 06:45:33<br/><strong>Category:</strong> Dataflow (Export / Import)<br/><strong>Version:</strong> 1.1.8<br/><strong>Priority:</strong> high<br/><strong>Status:</strong> closed<br/><strong>Reported By:</strong> <a href="http://www.magentocommerce.com/boards/member/67593/">dogfoodmedia</a></strong><br/><br/>Began receiving an error when the cron job attempted to update the Google Sitemap:<br />
<br />
File &quot;sitemap.xml&quot; cannot be saved. Please, make sure the directory &quot;/path/to/sitemaps/&quot; is writeable by web server.<br />
<br />
The path and the sitemap.xml are both writeable by the web server user. This error doesn't occur when you first generate the sitemap, only when you try to re-generate it.<br />
<br />
Based on the above, I tracked the error down to two code snippets. The file depends on what the desired behavior is for Varien_Io_File::is_writeable.<br />
<br />
Around line 113 of Mage_Sitemap_Model_Sitemap, we are throwing an exception if the sitemap file exists but is not writeable. However, only the filename is passed to $io-&gt;isWriteable() when that method appears to expect a full path. Therefore the exception is thrown even if the sitemap file is writeable (unless it happens to be in the cwd, i.e. html).<br />
<br />
Quick fix - change line 113 from:<br />
<br />
if ($io-&gt;fileExists($this-&gt;getSitemapFilename()) &amp;&amp; !$io-&gt;isWriteable($this-&gt;getSitemapFilename())) {<br />
<br />
to:<br />
<br />
if ($io-&gt;fileExists($this-&gt;getSitemapFilename()) &amp;&amp; !$io-&gt;isWriteable($this-&gt;getPath().$this-&gt;getSitemapFilename())) {<br />
<br />
This adds the path to the argument passed to isWriteable.<br />
<br />
However, the bug may actually be in Varien_Io_File. If so, the fix is:<br />
<br />
public function isWriteable($path)<br />
{<br />
    @chdir($this-&gt;_cwd);<br />
    $result = is_writeable( $path );<br />
    @chdir($this-&gt;_iwd);<br />
        <br />
    return $result;<br />
}<br />
<br />
This then respects the path passed to the object on construction and interprets the call correctly.<br/><br/><hr/>]]></description>
    </item>
    
                    <item>
        <title>RE: Mage_Sitemap / Varien_Io_File Bug - Destination no</title>
        <description><![CDATA[<em>#1 / Comment by <a href="http://www.magentocommerce.com/boards/member/58487/">fsj911</a></em><br/><br/>I have EXACTLY the same issue on 1.1.8, and was on the same path. I'll be modifying the code per your suggestion - tired of email warnings every morning. Thanks!]]></description>
    </item>
            <item>
        <title>RE: Mage_Sitemap / Varien_Io_File Bug - Destination no</title>
        <description><![CDATA[<em>#2 / Comment by <a href="http://www.magentocommerce.com/boards/member/1322/">pixelaté</a></em><br/><br/>Confirmed by another party, this is definitely an issue.]]></description>
    </item>
            <item>
        <title>RE: Mage_Sitemap / Varien_Io_File Bug - Destination no</title>
        <description><![CDATA[<em>#3 / Comment by Magento Team</em><br/><br/>Hello dogfoodmedia,<br />
<br />
This issue was fixed. The changes will be available in the next bugfix release.<br />
<br />
Thank you.]]></description>
    </item>
        </channel>
</rss>