If I have a buffer which contains the data of a file, how can I get a file descriptor from it? This is a question derived from how to untar file in memory
You can't. Unlike C++, the C model of file I/O isn't open to extension.