#include<iostream>
#include<fstream>
#define BUFFER_SIZE 11788889
using namespace std;
int main()
{
ifstream infile("hello.txt");
unsigned char buffer[BUFFER_SIZE];
int read_file_position=infile.tellg();
cout<<"input file position"<<read_file_position<<endl;
while(infile.read((char *)buffer,BUFFER_SIZE))
{
read_file_position=infile.tellg();
cout<<"input file position"<<read_file_position<<endl;
}
}
什麼,我試圖分裂我的文件只到bytes..splitting成MB或GB的數據塊會很棒..如果有辦法將它分成更大的塊,這將是有益的。因爲我的記錄沒有固定長度,所以塊大小會有所不同。我需要一個大文件分割成chunks.since我的文件大小是更大(50GB),我需要拆分成更大的塊
你需要將它分割成塊,爲什麼?你是指在內存中,還是將其分割成磁盤上單獨的較小文件? – EJP 2014-12-04 08:53:02
因爲我需要進一步提供這些具體卡盤分開線程.. – 2014-12-04 10:00:43
但這是一個後期部分..首先分成塊是主要 – 2014-12-04 10:10:43