Skip to content

Fulltext file deleted when being renamed to the name differing just by letter case #6120

Closed
@mpatas

Description

@mpatas

In JabRef version 5.0 the fulltext file can be deleted when trying to rename it to the almost the same name, as it already had, but with different letter case.

For example:

  1. Let's say we have an entry with Bibtexkey "Einstein1905a" and fulltext file "Einstein1905a.pdf".
  2. In the "Required Fields" tab, change the Bibtexkey to "Einstein1905A" (that is, change lower case "a" to upper case "A").
  3. In the "General" tab, "File" field, right click the file and choose "Rename file to defined pattern" in the menu shown after that.
  4. A message "File exists" will be shown, giving options "Overwrite" and "Cancel".
  5. Choose "Overwrite".
  6. Look for the file "Einstein1905a.pdf" or "Einstein1905A.pdf" in the directory where it is supposed to be, or try to open it from JabRef.

The expected behaviour is that after those steps, file with the new name ("Einstein1905A.pdf") would exist, or, at least, file with the old name ("Einstein1905a.pdf") would exist and an error message about failed renaming would be shown (perhaps suggesting a workaround - using an intermediate step of renaming to a name with added or removed letter).

But the actual behaviour is that after those steps neither file "Einstein1905a.pdf" nor "Einstein1905A.pdf" exists, it ends up being deleted.

If I understand it correctly, the message "File exists" is shown for compatibility (some operating systems allow the file names to differ only by letter case, some do not). That looks reasonable, but then there should probably be a check if the file causing this "naming conflict" is the same file being renamed.

Metadata

Metadata

Assignees

Labels

[outdated] type: bugConfirmed bugs or reports that are very likely to be bugs

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions