提交 53fbab5d 编写于 作者: D dongdaxiang

add fs_local_open example

上级 afaf9370
......@@ -63,15 +63,14 @@ static std::shared_ptr<FILE> fs_open_internal(const std::string& path,
if (buffer_size > 0) {
char* buffer = new char[buffer_size];
CHECK_EQ(0, setvbuf(&*fp, buffer, _IOFBF, buffer_size));
fp = {&*fp,
[ fp, buffer ] reinterpret_cast<FILE*> mutable {CHECK(fp.unique());
fp = nullptr;
delete[] buffer;
fp = {&*fp, [fp, buffer](FILE*) mutable { // NOLINT
CHECK(fp.unique()); // NOLINT
fp = nullptr;
delete[] buffer;
}};
}
};
}
return fp;
return fp;
}
static bool fs_begin_with_internal(const std::string& path,
......
......@@ -41,9 +41,9 @@ std::shared_ptr<FILE> shell_fopen(const std::string& path,
// Mostly copy from CPython code
static int close_open_fds_internal() {
struct linux_dirent {
int64 d_ino = 0;
long d_ino = 0; // NOLINT
off_t d_off;
uint16 d_reclen = 0;
unsigned short d_reclen = 0; // NOLINT
char d_name[256];
};
......
......@@ -95,7 +95,7 @@ template <typename T>
bool PrivateQueueDataFeed<T>::Start() {
CheckSetFileList();
std::string filename;
while (PickOneFile(&filename)) {
if (PickOneFile(&filename)) {
int err_no = 0;
std::string pipeline_cmd = "cat";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册