Transfer files or directories through sockets in C