Copy file Attributes#2286
Conversation
Add Copy_Attributes flag
| try { | ||
| return Files.copy(pathToSourceFile, pathToDestinationFile, StandardCopyOption.REPLACE_EXISTING) != null; | ||
| return Files.copy(pathToSourceFile, pathToDestinationFile, StandardCopyOption.REPLACE_EXISTING, | ||
| StandardCopyOption.COPY_ATTRIBUTES) != null; |
There was a problem hiding this comment.
This code ensures that the file permission of the temporary file are kept in https://github.com/JabRef/jabref/pull/2286/files#diff-4925b1e29b2566af2796f9c99008b9ddR86, but as far as I can see there is no guarantee that the temporary file has the same permission attributes as the original file.
There was a problem hiding this comment.
@tobiasdiez I am not sure either. However, the problem is that PosixPermission will fail on Windows with an exception
|
Okay, permissons are not copied. Maybe it is enough to check for Unix OS/POSIX support: |
|
Yes I think checking
should be enough. Do you want to add this, or should I? |
|
Please do add this. I am answering from phone 2016-11-18 23:51 GMT+01:00 Tobias Diez notifications@github.com:
|
Should fix #2285 and #2279 , too.
Edit// Needs Testing for #2285
Remove PosixFilePermission, as this will throw an Exception on Win
gradle localizationUpdate?Add Copy_Attributes flag