Why ipfs.files.write doesn't returns the CID

Any reason why the ipfs.files.write returns the Promise<void> instead of Promise<CID>?
How would one get the CID for the file written in the MFS?

The fact that you have to call ls or stat to get the actual CID after a write definitely seems like a design flaw to me, simply because it’s extra added overhead/latency. The write command itself has to know what the CID is that it’s writing to (right?), so there should at least an option on the command that says “send me the CID back when done”.

it really looks like that. i wonder what is the reason why they decided to make it like that.
so stat with the path does the trick but that is so much overhead when dealing with million of files