We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0de2422 commit d3f77d5Copy full SHA for d3f77d5
bindings/storage/File.cpp
@@ -64,7 +64,13 @@ py::class_<BFile, BNode, BPositionIO>(m, "BFile")
64
py::bytes pyBytes(buffer.data(),bytesRead);
65
return py::make_tuple(pyBytes, bytesRead);
66
},"", py::arg("size"))
67
-.def("ReadAt", &BFile::ReadAt, "", py::arg("location"), py::arg("buffer"), py::arg("size"))
+//.def("ReadAt", &BFile::ReadAt, "", py::arg("location"), py::arg("buffer"), py::arg("size"))
68
+.def("ReadAt", [](BFile& self, off_t location, size_t size)->py::tuple{
69
+ std::vector<char>buffer(size);
70
+ ssize_t bytesRead = self.ReadAt(location, buffer.data(), size);
71
+ py::bytes pyBytes(buffer.data(),bytesRead);
72
+ return py::make_tuple(pyBytes, bytesRead);
73
+},"", py::arg("location"),py::arg("size"))
74
//.def("Write", &BFile::Write, "", py::arg("buffer"), py::arg("size"))
75
.def("Write", [](BFile& self, py::buffer buffer){
76
py::buffer_info info = buffer.request();
0 commit comments