Loading test/wr_test.cpp +19 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,18 @@ int main(int argc, char* argv[]) { return -1; } /* Access nonexisting file */ ret = access(p.c_str(), F_OK); if(ret == 0){ cerr << "ERROR: succeeded on accessing non-existing file" << endl; return -1; }; if(errno != ENOENT){ cerr << "ERROR: wrong error number while accessing non-existing file: " << errno << endl; return -1; } /* Stat nonexisting file */ ret = stat(p.c_str(), &st); if(ret == 0){ Loading Loading @@ -67,6 +79,13 @@ int main(int argc, char* argv[]) { return -1; } /* Access existing file */ ret = access(p.c_str(), F_OK); if(ret != 0){ cerr << "ERROR: Failed to access file: " << strerror(errno) << endl; return -1; }; /* Check file size */ ret = stat(p.c_str(), &st); if(ret != 0){ Loading Loading
test/wr_test.cpp +19 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,18 @@ int main(int argc, char* argv[]) { return -1; } /* Access nonexisting file */ ret = access(p.c_str(), F_OK); if(ret == 0){ cerr << "ERROR: succeeded on accessing non-existing file" << endl; return -1; }; if(errno != ENOENT){ cerr << "ERROR: wrong error number while accessing non-existing file: " << errno << endl; return -1; } /* Stat nonexisting file */ ret = stat(p.c_str(), &st); if(ret == 0){ Loading Loading @@ -67,6 +79,13 @@ int main(int argc, char* argv[]) { return -1; } /* Access existing file */ ret = access(p.c_str(), F_OK); if(ret != 0){ cerr << "ERROR: Failed to access file: " << strerror(errno) << endl; return -1; }; /* Check file size */ ret = stat(p.c_str(), &st); if(ret != 0){ Loading