-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider normalizing file paths on Windows to Unix style #10871
Comments
@ror3d We had some internal discussions about that a while ago. Some were in favour of keeping it OS specific, some.not. Pro keeping it was to avoid confusion at newbies using their local library only. Moreover, when comfiguring a user specific file directory, it is "their" file directory on their OS and should be kept. Java perfectly handles / and \ in paths. Please also think of backward compatibility. Noz everyone updates JabRef instantly. When JabRef "normalizes" everything, users of older versions cannot open the file again. They will ask why the team introduced the change. Only because there could be issues? I don't remember any one reporting issues there. What about other tools such as Zotero relying on JabRef's format. Do you want to force them to change their code, too? To implement migrations? Handling both versions? I know that the current implementation is a WTF for programmers. But please think of the users!! Finally, some changes could be done at a complete new file field. See Therefore closing as not planned. We can exhange more arguments here to also improve the next iteration of the file handling. |
Actually, I was just testing this, and right now I don't recall how I had reproduced paths having backward slashes. I believe at some point I had a file showing with them, but maybe I got mistaken by some other part of the file (in the settings section maybe), because testing now I found that these paths are already converted to forward slashes. The normalization is happening in the public void setLink(String link) {
if (!isOnlineLink(link)) {
this.link.setValue(link.replace("\\", "/"));
} else {
this.link.setValue(link);
}
} So yeah, apparently it's already as I hoped. Sorry for the trouble. |
@ror3d Thank you for checking. While writing, I was thinking, we had that thing... -- But I did not check. - If you see that "wrong" path again, please comment so that we can track down... I am a bit sure that I also saw it at some place... |
Path with backslashes may be from BetterBibTeX Zotero Plugin |
Related issues:
Maybe not happening in recent versions, but we need to check. |
Is your suggestion for improvement related to a problem? Please describe.
From what I could gather reading the code, paths on Windows for linked files are kept with backslash
\
and those are escaped as\\
to avoid problems, as colons in URLs are escaped with backslash.This can cause problems if sharing the database across different OSs.
Describe the solution you'd like
Since windows supports file paths with forward slash
/
, and to avoid issues of paths not working when sharing the database across systems with different OS, it might be best to convert any local file path to unix style.The text was updated successfully, but these errors were encountered: