-
Notifications
You must be signed in to change notification settings - Fork 39
Can't create RPM greater than 2 GB #96
Comments
Sorry for the late reply on this. I am pretty busy with other stuff. I will check this out. I am not sure this would be only issue with files +2GB though. If you have some experience, I would appreciate your help. |
Could you maybe provide a simple, reproducible code snippet for that? |
Actually the transferTo method must be called in a loop as it seems not to be guaranteed that all content is transferred in one call.
I tried to create a fix for that. Thanks to your stackoverflow link it was pretty easy to find out what I made wrong. I created a manual build of this single bundle [1], as I don't have a real way to test it right now, it would be awesome if you could give it a try and let me know if this solved your issue. |
I tested the fix by invoking the new code indirectly through the de.dentrassi.maven.rpm Maven plugin and it successfully created a .rpm file larger than 2GB (the file created was 2487127517 bytes). I can no longer reproduce the problem, so I believe the fix works. At least on my system and use case. |
Cool. Thanks. I will try to get out an update ASAP. However I cannot make any promises for this or next week. |
Actually the transferTo method must be called in a loop as it seems not to be guaranteed that all content is transferred in one call.
RpmWriter.finish() uses FileChannel.transferTo() to move data from a temporary file to the final RPM file. When the temporary file is greater than 2 GB, only 2GB of data are transferred. StackOverflow has some discussions about transferTo() and the 2GB size limit that seem to confirm the theory that the truncation is happening in FileChannel.transferTo().
The text was updated successfully, but these errors were encountered: