[File] Piping into file; will it bloat RAM?

Arif Driessen arifd86 at gmail.com
Thu Oct 20 09:55:40 UTC 2022


Hello,

I am using `file` to get the mime-type of blobs of data streamed to me. I
open a process and a pipe, and a pass the bytes as they come to me to
`file`. Then I close the pipe and wait for `file` to return me a mime-type.

This works wonderfully, except, I'm worried, that file may be collecting
into RAM the entire contents of the buffer as they are being piped.

For example, if I am given an 180GiB zip file, and I keep feeding those
bytes to the pipe, will it blow up my RAM? Or does `file` employ something
cleverl; even if just writing to the file system, or perhaps working on
chunks and forgetting the past?

Thanks for your help!

Arif Driessen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.astron.com/pipermail/file/attachments/20221020/c3b9082d/attachment.htm>


More information about the File mailing list