JabRef / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
3.62k stars 2.57k forks source link

Filepath saved on Windows does not open on Linux #3311

Closed JoKalliauer closed 6 years ago

JoKalliauer commented 7 years ago
JabRef 4.0
Linux 4.10.0-37-generic amd64 
Java 1.8.0_144

Steps to reproduce:

  1. create an idential folderstructure on Windows and on Linux (f.e. use sync-systems like: dropbox, onedrive, googledrive, owncloud)
  2. JabRef on Windows&Linux must have the same "Main file directory" (f.e. Linux: /home/jkalliau/ownCloud and Windows: C:/Users/jkalliau/ownCloud)
  3. add a PDF-File to an article in JabRef to a bibtex-file on Windows
  4. try to open this PDF-File in JabRef on Linux

The problem is that Windows saves:

File = {:..\\..\\Literature\\DNA\\Weitere\\Bai_Martin_Scheres_Dietz_2012_PNAS.pdf:PDF},
file = {:PhDJK\\Literature\\MD\\Amber17.pdf:PDF},

But Linux saves as:

file = {:PhDJK/Literature/MD/Amber17.pdf:PDF},

With JabRef 3.8.2 neither Windows nor Linux had problems using different File-Structures, but now with JabRef 4 on Linux it does (JabRef can't find the file). :-(

On Windows with JabRef4.0 it still works also with Linux-Filepathes.

This bib-file has developed over some time with JabRef 3.x and it always worked to open with JabRef 3.8.2 on Windows and on Linux, also both added file-paths in a different form.

I would stay with JabRef 3.8.2, but due to bug #2879 I prefer JabRef 4.

Otherwise I might have to use sed to correct the path-mistakes.

bib-file with filepath saved on Windows ``` % Encoding: UTF-8 @Article{bai2012cryo, Title = {{Cryo-EM} structure of a {3D} {DNA-origami} object}, Author = {Bai, Xiao-chen and Martin, Thomas~G and Scheres, Sjors~HW and Dietz, Hendrik}, Journal = {Proceedings of the National Academy of Sciences}, Year = {2012}, Month = dec, Number = {49}, Pages = {20012--20017}, Volume = {109}, Adsnote = {Provided by the SAO/NASA Astrophysics Data System}, Adsurl = {http://adsabs.harvard.edu/abs/2012PNAS..10920012B }, Doi = {10.1073/pnas.1215713109}, File = {:..\\..\\Literature\\DNA\\Weitere\\Bai_Martin_Scheres_Dietz_2012_PNAS.pdf:PDF}, Groups = {DNA}, Keywords = {rank2}, Publisher = {National Acad Sciences} } @Article{case2017amber, author = {Case, David A and Walker, Ross C and Cheatham III, Thomas E and Simmerling, Carlos LI and Roitberg, Adrian and Merz, Kenneth M and Luo, Ray and Darden, Tom A and Wang, Junmei and Duke, Robert E and Daniel R. Roe and Scott LeGrand and Jason Swails and Andreas W. Götz and David Cerutti and Tyler Luchko and Gérald Monard and Celeste Sagui and Feng Pan and Charles Lin and Daniel Mermelstein and Pengfei Li and Alexey Onufriev and Saeed Izadi and Romain M. Wolf and Xiongwu Wu and Holger Gohlke and Nadine Homeyer and Ruxi Qi and Wesley M. Botello-Smith and Li Xiao and D’Artagnan Greene and Tim Giese and Taisung Lee and Darrin York and Jian Liu and Hai Nguyen and Igor Omelyan and Andriy Kovalenko and Peter A. Kollman and Zhang, W and others}, title = {Amber 2017 Reference Manual (Covers Amber16 and AmberTools17)}, journal = {University of California, San Francisco}, year = {2017}, month = may, day = {29}, file = {:PhDJK\\Literature\\MD\\Amber17.pdf:PDF}, url = {http://ambermd.org/doc12/Amber17.pdf}, } @Comment{jabref-meta: databaseType:bibtex;} @Comment{jabref-meta: grouping: 0 AllEntriesGroup:; 1 StaticGroup:DNA\;0\;1\;\;\;\;; } ```
lenhard commented 7 years ago

@Siedlerchr You have recently modified the file path serialization, right? Can you comment on this?

Siedlerchr commented 7 years ago

I will look into this, first guess is that the relative path is passed as String to the open method

Am 17.10.2017 2:24 nachm. schrieb "Jörg Lenhard" notifications@github.com:

@Siedlerchr https://github.com/siedlerchr You have recently modified the file path serialization, right? Can you comment on this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/JabRef/jabref/issues/3311#issuecomment-337214329, or mute the thread https://github.com/notifications/unsubscribe-auth/AATi5DMB-ywN5Xe5hFN5nLL69DggN50dks5stJxjgaJpZM4P6kZ8 .

lenhard commented 6 years ago

@JoKalliauer We think we have a fix for this. Can you please try out the version that includes the fix, which is available here: http://builds.jabref.org/linuxlink/ and let us know if it works for you.

JoKalliauer commented 6 years ago
JabRef 4.1-dev--snapshot--2017-11-04--linuxlink--4ffdabf5c
Linux 4.10.0-38-generic amd64 
Java 1.8.0_151
JabRef 4.1-dev--snapshot--2017-11-04--linuxlink--4ffdabf5c
Windows 7 6.1 amd64 
Java 1.8.0_152

Thanks now JabRef4.1LinuxLink on Windows adds forward slashes, but the file-references from my JabRef3.8-Win.bib file can still not be opened on JabRef4.1LinuxLink on Linux, therefore I had to use the terminal-command to change the old JabRef-file:

sed -ri 's/  (f|F)ile[ ]+= \{:([-[:alnum:] _.\/\;\:]+)\\\\([-[:alnum:] _.\\\/\;\:\(\)]+).([[:alpha:]]{3}):(MHT|PDF|Text|JPG-Bild|Word)\},/  \1ile = \{:\2\/\3.\4:\5\},/' filename.bib

Therefore old JabRef3.8-files are not update-able to JabRef4.1. (only by hand or the command above)

In linuxlink seems some translation missing (see Error-Log below).

Error-Log ``` Warning: no message translation for "Show console output (only necessary when the launcher is used)" for locale de Opening: /home/jkalliau/ownCloud/Master/BP2/literature.bib Opening: /home/jkalliau/ownCloud/Master/jk/JK2EuroC/a4sample.bib Opening: /home/jkalliau/ownCloud/PhDJK/LaTeX/Style/LiteratureJK.bib Warning: no message translation for "JabRef cannot access the file because it is being used by another process." for locale de Warning: no message translation for "JabRef cannot access the file because it is being used by another process." for locale de Warning: no message translation for "JabRef cannot access the file because it is being used by another process." for locale de Warning: no message translation for "JabRef cannot access the file because it is being used by another process." for locale de Warning: no message translation for "JabRef cannot access the file because it is being used by another process." for locale de Warning: no message translation for "JabRef cannot access the file because it is being used by another process." for locale de ```
Siedlerchr commented 6 years ago

Thanks for your feedback! You could run a cleanup operation to rename the files, that should then set the files links correctly.

Regarding the translations: They will usually be added before the next release, (at least the German, to avoid double work during dev). The changes are now in the master. So you can switch to that to stay on top with actual changes

JoKalliauer commented 6 years ago

@lenhard: Please remove the waiting-for-feedback-label, or is there feedback missing?

lenhard commented 6 years ago

@JoKalliauer Nope, I've removed the label.