Reputation: 467
Is it possible in C++ to somehow get a pointer to the beginning of an opened file so that it ( the pointer ) can be passed to the unix write function together with the size of the file?
Just to be clear: I want to pass the whole file to a write-like function - how do I do this?
Upvotes: 1
Views: 813
Reputation: 75673
sendfile() is specifically for this purpose on POSIX platforms when sending over the network, and the kernel handles the intricacies of doing it.
Upvotes: 4