validate_read_write_syscalls.cpp 1.46 KB
Newer Older
Julius Metz's avatar
Julius Metz committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
#include <chrono>
#include <thread>
#include <iostream>
#include <fstream>
#include <string>



int main(){
    std::ofstream f1;
    std::ifstream f2;
    f1.open("write_trash");
    
    std::string a = "8EXtu1Q2PeToztR67j4PTJik40PLUpztaryX23cnRUaNoyRS8k9nmvw40LSm5zeRFkoIyi3uFeOcpy3UEKCarItcwYsyasRuCA8FZA0OyP6LNgOU9thW0K2hOcdscK4ETJxSZDr86EeOI5HRHciThLuwWS5tbrGQiGKs7n3G4fGRcX6zgYCRtMDGHclZZKYfsLYEwDTZF6qSq3uOFkvwwMf7ioEz7uap6S6C3EXZkSJXIsW4N3IZHZIeIsTYFx0QvYBV0FmJDbGQwx3V6SHja8hCnhq5e3OJGcbeLAwlpf3g6s8FPh9fKUBmkl8ZIY3mf2o4o95Yt3gCZf1Pj6WpyQVBnup533YeCHELRNN7ZJOKKrZf0h7bSIF6Xm4PzskR1KjRm8Y9XYl2EebBrRhfuruMsN01C2hHNVyXhezDnnrAvoVQsC27KnAtlPBeGqjaJJrez10eQLKWMklFI9oFc90RPzqJD2uL7Ap5nsjkToWQYx87oMxRTLLnYiHLcb4pIroThdXfTW98lFRh9EkmrWXHfGRgB4l1ILDmOWSmVzOUm6wtOdDcgPTyNfVp2ASxObTo4fwWrx5bR4qUHFhIhE4GNbsKNGKor4Jh8U0xQpQgqVkbzyqtPc6sHJq9FDNaaI0m7PFwRDs0yfLzxgLTCC8HICBPbjmxDPm1yVXXa7OYxwRroic5i0lIqlTy1oPhk0WbovGxoiLSLVjFr4DuYlKt7Qra4dx2A2FFIqtU5g37EBiYe975OEI9zRXGhp0m8JvFf5VXvMeAPgg787j5NekDuSnpcFBv7fy6uBDyKSkBlFcF1uP37QrhsgweWxzpkj0XmQbXW78hMARUrP3MP4DoLOsNk33HvBqPLZwZminjxjCYDZWTKLVLyG955RKYQYq0kTd8kTAdLAQBI1G28JtqMK3EbGWEJdu6LSBO8LqRtksuNM5II1LGAtYro3RdvAo24RJAeW4QqY8ERaJISRiWcyXNCdYThpHd5KRama2cHV5Diai3GcuO337uonID";
    char b[1024];
    std::chrono::seconds interval( 1 );
   
    for(int i = 0; i < 10; i++) {
        f1  << a;
        f2.open("1kibfiletoread");
        f2 >> b;
        f2.close();
        std::this_thread::sleep_for( interval );
    }
    return 0;
}