Hi Erick,

it would be good, if you use the new Java 7 methods to set/unset perms. Because 
those fail hardly with exceptions. So in future we should "deprecate/disallow" 
the whole broken java.io.File class.

So use java.io.nio.file package to do this stuff - we just did not fix this for 
DIH, but its non-ideal how it's currently done, because you get no good 
exceptions if something with setting perms is not working!

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: [email protected]


> -----Original Message-----
> From: Erick Erickson [mailto:[email protected]]
> Sent: Thursday, September 04, 2014 5:13 PM
> To: [email protected]
> Subject: Re: [jira] [Commented] (LUCENE-5906) Use Files.delete instead of
> File.delete + made up exception
> 
> FYI, I'm working on an improvement (SOLR-5322) that adds a number of tests
> that explicitly set a directory or file to r/o. As far as I know they 
> properly set
> the perms back to r/w before they're done and they pass on OS X (after
> failing before I reset the perms). But just in case  you see some weirdness
> after I check it in on the windows machines you'll know who to blame.
> 
> Erick
> 
> On Thu, Sep 4, 2014 at 8:09 AM, Uwe Schindler (JIRA) <[email protected]>
> wrote:
> >
> >     [
> > https://issues.apache.org/jira/browse/LUCENE-5906?page=com.atlassian.j
> > ira.plugin.system.issuetabpanels:comment-
> tabpanel&focusedCommentId=141
> > 21447#comment-14121447 ]
> >
> > Uwe Schindler commented on LUCENE-5906:
> > ---------------------------------------
> >
> > Hi the patch did not pass, too. The problem here is simple: the file was
> made read-only, so cannot be deleted. You need to add
> {{f.setWritable(true);}} at the end of test.
> >
> > Otherwise it passes on windows, I ran the whole test suite ignoring failures
> and this was the only one broken.
> >
> >> Use Files.delete instead of File.delete + made up exception
> >> -----------------------------------------------------------
> >>
> >>                 Key: LUCENE-5906
> >>                 URL: https://issues.apache.org/jira/browse/LUCENE-5906
> >>             Project: Lucene - Core
> >>          Issue Type: Bug
> >>            Reporter: Robert Muir
> >>         Attachments: LUCENE-5906.patch, LUCENE-5906.patch,
> >> LUCENE-5906.patch, LUCENE-5906.patch, LUCENE-5906.patch
> >>
> >>
> >> We are on java7, if we cannot delete a file, this one returns a real
> exception as to why.
> >
> >
> >
> > --
> > This message was sent by Atlassian JIRA
> > (v6.3.4#6332)
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected] For
> > additional commands, e-mail: [email protected]
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected] For additional
> commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to