(v0.19-24-g0617ca1 with changes)
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <iostream>
#include <chrono>
#include <system_error>
#include <map>
#include <fcntl.h>
Go to the source code of this file.
|
int | main (int argc, const char *argv[]) |
|
◆ clock_type
◆ main()
int main |
( |
int |
argc, |
|
|
const char * |
argv[] |
|
) |
| |
Definition at line 13 of file stattest.cpp.
14 auto lastOutputTime = clock_type::now();
19 unsigned long long attempts = 0;
20 unsigned long long success = 0;
21 unsigned long long fail = 0;
22 std::map<int, unsigned long long> errorCodes;
26 auto retval = stat(argv[1], &statbuf);
35 auto now = clock_type::now();
37 if (now > lastOutputTime + std::chrono::seconds(1)) {
38 std::cout << attempts <<
" " << success <<
" " << fail <<
": ";
40 for (
auto& item : errorCodes) {
41 std::cout << std::system_category().default_error_condition(item.first).message();
42 std::cout <<
": " << item.second;
51 unsigned long long count = 0;
56 auto fd = creat(argv[2], 0644);
57 write(fd, argv[1], 16);
61 auto now = clock_type::now();
63 if (now > lastOutputTime + std::chrono::seconds(1)) {
64 std::cout << count <<
"\r";