Message365755
I wasn't aware of this issue and opened another one which I just closed as a duplicate -
https://bugs.python.org/issue40175
I also submitted a PR for the other one -
https://github.com/python/cpython/pull/19336
The implementation does involve shifting the bytes of the files and updating the offset of each file in the central directory.
I do handle the case in which the central directory order and the order of the actual files in the archive isn't the same simply by sorting the central directory in memory before execution.
The only issue I see here is the fact that if something happens during the process, the archive might get corrupted - but IMO it's worth it.
Many tools provide that functionality (Windows, Total Commander) and as far as I know they do it in place.
In the worst case, it's possible to implement it by creating a temp archive like Serhiy suggested - not too difficult to implement either since it simply requires duplicating the file and operating on it. |
|
Date |
User |
Action |
Args |
2020-04-04 10:26:54 | yudilevi | set | recipients:
+ yudilevi, loewis, rhettinger, terry.reedy, lars.gustaebel, christian.heimes, rossmclendon, eric.araujo, ubershmekel, victorlee129, sandro.tosi, chroipahtz, serhiy.storchaka, Arthur.Darcet, Dave Sawyer, gambl, denfromufa |
2020-04-04 10:26:54 | yudilevi | set | messageid: <1585996014.08.0.840756726993.issue6818@roundup.psfhosted.org> |
2020-04-04 10:26:54 | yudilevi | link | issue6818 messages |
2020-04-04 10:26:53 | yudilevi | create | |
|