Say I have an http or tcp server running, which serves tarballs (.tgz files).
Is there some way I can receive files individually so I can do something like this:
nc localhost 5000 | how can I read multiple files here and save each to disk?
to explain further, when I connect to the server, I'd like it to respond with a series of .tgz files. My question is, if it's a tcp server, how can I write each file so that it comes in separately.
The only thing I would know how to do would be to stream the data to a single file, but I don't know how to write out multiple files.
This is potentially an answer: https://stackoverflow.com/a/44894223/1223975
But I don't understand how to write each file out individually.