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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
fstream drive1("main1.vhd", ios::in | ios::out | ios::binary);
fstream drive2("main2.vhd", ios::in | ios::out | ios::binary);
fstream drive3("main3.vhd", ios::in | ios::out | ios::binary);
fstream drive4("main4.vhd", ios::in | ios::out | ios::binary);
drive1.seekg(0, ios::end);
const long size1 = drive1.tellg();
drive1.seekg(0, ios::beg);
drive2.seekg(0, ios::end);
const long size2 = drive2.tellg();
drive2.seekg(0, ios::beg);
drive3.seekg(0, ios::end);
const long size3 = drive3.tellg();
drive3.seekg(0, ios::beg);
drive4.seekg(0, ios::end);
const long size4 = drive4.tellg();
drive2.seekg(0, ios::beg);
if (size1!=67108864 && size2!=67108864 && size3!=67108864 && size4!=67108864)
{
cout << "The hard drive files are not the correct size and cannot be addressed properly\n";
return 9;
}
drive1.seekp(0, ios::beg);
drive2.seekp(0, ios::beg);
drive3.seekp(0, ios::beg);
drive4.seekp(0, ios::beg);
unsigned char byte = 0xff;
drive1.write(reinterpret_cast<char*>(byte), sizeof(byte));
return 0;
}
|