#temporary-files #file #deleted #com #disk #windows #i-stream

tempfile-istream

COM IStream on an exclusive temp file which is deleted on release

8 releases (5 stable)

1.0.4 May 20, 2022
1.0.3 Mar 10, 2022
1.0.2 Feb 10, 2022
0.3.0 Feb 8, 2022
0.1.0 Feb 7, 2022

#293 in Windows APIs

MIT license

13KB
160 lines

tempfile-istream

This is a read/write implementation of the windows crate's Windows::Win32::System::Com::IStream interface backed by a temp file on disk. The temp file is created with SHCreateStreamOnFileEx, using FILE_ATTRIBUTE_TEMPORARY and FILE_FLAG_DELETE_ON_CLOSE so it will be deleted by the OS as soon as the last reference to the IStream is dropped.

It is intended as an alternative to SHCreateMemStream or CreateStreamOnHGlobal, both of which will hold the entire stream in memory.

Dependencies

~129MB
~2M SLoC