<!--
RSS generated by JIRA (4.4#649-r158309) at Wed May 22 09:18:53 CDT 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://dev.clojure.org/jira/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=labels+%3D+delete-file&tempMax=1000&field=key&field=summary
-->
<!-- If you wish to do custom client-side styling of RSS, uncomment this:
<?xml-stylesheet href="http://dev.clojure.org/jira/styles/jiraxml2html.xsl" type="text/xsl"?>
-->
<rss version="0.92">
    <channel>
        <title>Clojure JIRA</title>
        <link>http://dev.clojure.org/jira/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=labels+%3D+delete-file</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="1" total="1"/>
                <build-info>
            <version>4.4</version>
            <build-number>649</build-number>
            <build-date>25-07-2011</build-date>
        </build-info>
<item>
            <title>[CLJ-1159] clojure.java.io/delete-file doesn&apos;t return the status of the deletion(true/false)</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1159</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;initially reported it here(somehow):&lt;br/&gt;
&lt;a href=&quot;https://groups.google.com/d/msg/clojure/T9Kvr0IL0kg/wcKBfR9w_1sJ&quot;&gt;https://groups.google.com/d/msg/clojure/T9Kvr0IL0kg/wcKBfR9w_1sJ&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Basically clojure.java.io/delete-file doesn&apos;t ever return false (even when silently is true, it returns the value of silently), it&apos;s due to how it&apos;s implemented - but it&apos;s obvious from the code, so I&apos;ll stop here.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;

&lt;p&gt;PS: this is what I&apos;m using as my current workaround:&lt;br/&gt;
(defn delete-file&lt;br/&gt;
&quot;&lt;br/&gt;
an implementation that returns the true/false status&lt;br/&gt;
which clojure.java.io/delete-file doesn&apos;t do(tested in 1.5.0-RC14)&lt;br/&gt;
&quot;&lt;br/&gt;
  [f &amp;amp; &lt;span class=&quot;error&quot;&gt;&amp;#91;silently&amp;#93;&lt;/span&gt;]&lt;br/&gt;
  (let &lt;span class=&quot;error&quot;&gt;&amp;#91;ret (.delete (clojure.java.io/file f))&amp;#93;&lt;/span&gt;&lt;br/&gt;
    (cond (or ret silently)&lt;br/&gt;
      ret&lt;br/&gt;
      :else&lt;br/&gt;
      (throw (java.io.IOException. (str &quot;Couldn&apos;t delete &quot; f)))&lt;br/&gt;
      )&lt;br/&gt;
    )&lt;br/&gt;
  )&lt;/p&gt;

&lt;p&gt;I&apos;m sure you guys can find a better way, but as a clojure newbie(really!) that&apos;s what I have.&lt;/p&gt;</description>
                <environment>any</environment>
            <key id="15999">CLJ-1159</key>
            <summary>clojure.java.io/delete-file doesn&apos;t return the status of the deletion(true/false)</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="4" iconUrl="http://dev.clojure.org/jira/images/icons/priority_minor.gif">Minor</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="atkaaz">AtKaaZ</reporter>
                        <labels>
                        <label>delete-file</label>
                        <label>evil</label>
                        <label>or</label>
                    </labels>
                <created>Sun, 10 Feb 2013 13:55:52 -0600</created>
                <updated>Sun, 10 Feb 2013 14:21:28 -0600</updated>
                                    <version>Release 1.5</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="30575" author="atkaaz" created="Sun, 10 Feb 2013 14:01:08 -0600"  >&lt;p&gt;I kinda just realized it affects all versions since and including 1.2, because it appears that its implementation was the same since then.&lt;/p&gt;

&lt;p&gt;If it&apos;s not meant to return the result of the delete, maybe it should specifically return nil and/or the doc say something?&lt;/p&gt;</comment>
                    <comment id="30576" author="seancorfield" created="Sun, 10 Feb 2013 14:21:28 -0600"  >&lt;p&gt;As noted in a thread on the Clojure ML, you can pass a known value in the second argument position to detect a delete that failed:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;(clojure.java.io/delete-file some-file :not-deleted)&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;This returns true on success and :not-deleted on failure.&lt;/p&gt;

&lt;p&gt;However the docstring could be better worded to make that intention clear. Perhaps:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;Delete file f. Return true if it succeeds. If silently is nil or false, raise an exception if it fails, else return the value of silently.&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;This allows you to detect whether the delete succeeded without catching an exception by passing a non-true truthy value as the second argument.&lt;/tt&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>
</channel>
</rss>