Can anyone show a block scheme of the algorithm when copying а file in oprationg system?
Are you wanting it flowcharted? I can't do that for you but here's a simple file copy routine in C++.
void copyFile(std::string fname1, std::string fname2, unsigned long long size)
std::ifstream ifs(fname1, std::ios::in | std::ios::binary);
std::ofstream ofs(fname2, std::ios::out | std::ios::binary | std::ios::trunc);
cout << "\nCan't open file " << fname1 << " for input!" << endl;
cout << "\nCan't open file " << fname2 << " for output!" << endl;
chunk = (size < 4096) ? size : 4096;
size -= chunk;
I left out minor details like checking whether the reads and writes succeed, but that should mostly get it done for you. Cheers.