I would like to know how I can do a tftp download of a file from a remote machine within a user space program running on my machine. I can use "system" command in my C program, but because tftp is an interactive utility - it will not be of use.

Ideally, after the successful download of the file, I would also like to have the file descriptor of the downloaded file so that I can do some processing on the downloaded file.

I am constrained to use tftp only.
Also let me know how it is possible using the system command in C

Your help is appreciated,