As a means of giving you a means to answer the question and decide engineering tradeoffs - not because I believe introducing new code for this is the best way to go about it - you might consider how this is avoided when writing to TP logs (-11! cannot stream from anymap files).
This was a consideration in some of our test code when my team looked at this upgrade in 2019, and we wrote a generic routine to take a list of input and manually write it to a TP log format. Repurposing for your use, it would be something like:
f:get`:file
h:hopen hdel`:file
h f
hclose h
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…