[Lldb-commits] [PATCH] D31079: Replace std::ofstream with llvm::raw_fd_ostream

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 17 12:20:10 PDT 2017


labath added a comment.

In https://reviews.llvm.org/D31079#703911, @zturner wrote:

> In the places where you want to read from an `ifstream` and write to a socket, you might consider using `llvm::sys::fs::copy_file`, declared in `Support/FileSystem.h`.  Currently it takes two paths, but all it does is call `openFileForRead()` on the first one and `openFileForWrite()` on the second one to get FDs.  So you could probably add an overload that takes two FDs, and have the path version just call the FD version.  Then you could call the FD version directly with an FD for your file and an FD for your socket.


Unfortunately, that won't be enough. I need to split the data into chunks and add a header before each chunk. I guess I'll just stick with LLDB's File class for now (?)


https://reviews.llvm.org/D31079





More information about the lldb-commits mailing list