[
https://issues.apache.org/jira/browse/LUCENE-4190?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13406669#comment-13406669
]
Andi Vajda commented on LUCENE-4190:
------------------------------------
If Joe user gives c:\ as their index directory, which is silly, sure, it's even
worse to just delete all files in there.
Even if you just delete files there that are prefixed with _, we should know
better than that. By putting the files we want to control into their own
directory, a subdirectory of the Lucene index directory, there is very little
room for mistakes.
_ is just not a namespace for files reserved to Lucene, but a sub-directory
chosen by Lucene instead is.
If you persist in picking just _, why not picking _90439043_ to make it at
least more unique ?
> IndexWriter deletes non-Lucene files
> ------------------------------------
>
> Key: LUCENE-4190
> URL: https://issues.apache.org/jira/browse/LUCENE-4190
> Project: Lucene - Java
> Issue Type: Bug
> Reporter: Michael McCandless
> Assignee: Robert Muir
> Fix For: 4.0, 5.0
>
> Attachments: LUCENE-4190.patch, LUCENE-4190.patch
>
>
> Carl Austin raised a good issue in a comment on my Lucene 4.0.0 alpha blog
> post:
> http://blog.mikemccandless.com/2012/07/lucene-400-alpha-at-long-last.html
> IndexWriter will now (as of 4.0) delete all foreign files from the index
> directory. We made this change because Codecs are free to write to any files
> now, so the space of filenames is hard to "bound".
> But if the user accidentally uses the wrong directory (eg c:/) then we will
> in fact delete important stuff.
> I think we can at least use some simple criteria (must start with _, maybe
> must fit certain pattern eg _<base36>(_X).Y), so we are much less likely to
> delete a non-Lucene file....
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]