Hello
I opened a device file (“/dev/net/tun”) using NIFs(with help of rustler) and it returns an integer file descriptor (and also done the configuration to setup a tun device using NIFs). I want to perform read and write operations on the device file using the integer file descriptor in erlang without using NIFs but i don’t know how to and i don’t know if its possible at all.
Questions:
-
Is there any way to read from integer file descriptors returned by the operating system open systemcall ? or convert the integer file descriptor to something that erlang accepts for read and write?
-
if it’s not possible at all, what is the reason for it? is there something related to BEAM that does not allow reading from integer file descriptors returned by operating system open systemcall ?