improve OleFileIO_PL to write OLE files
It would be a great improvement if OleFileIO was able to write OLE files, in order to modify or create them.
But this would require a lot of changes in the code. The main issues are the management of free sectors, the use of small vs. large streams, and the use of red-black trees to keep the stream names sorted (see reference documents about the OLE format).
I think the best order to add write features would be:
- write a single FAT sector in the file. => done in v0.32 (commit 54c820c)
- write stream data for an existing stream in FAT, same size. => done in v0.32 (commit ef34c24)
- write a single MiniFAT sector in the file
- write stream data for an existing stream in MiniFAT, same size.
- write the header
- write the FAT (and DIFAT), same size
- write the MiniFAT, same size
- write the directory, same size
- rename a stream/storage (no change to red-black tree)
- release a sector as unused
- allocate a new sector, extending the OLE file size and/or the FAT/MiniFAT if necessary
- trim down the file, removing unused sectors at the end
- write stream data for an existing stream, changing its size
- delete a stream/storage (requires to update the red-black tree)
- add a new storage in the directory
- add a new stream
- create a new OLE file from scratch
Please vote for this issue if you want to give it more priority.