I'm using an API (that I cannot change) with a function that accepts a directory file descriptor. This function creates some files inside the directory and fills them.
What I want to do is to send this directory over socket, and the current implementation is:
create local directory -> tar -> read the tar file -> send via socket -> untar
Is it possible to avoid to create locally the directory and tar, passing the bytes directly over socket? I cannot pass the socket as file descriptor because it expects a directory.