我正在尝试编写一个程序,它接受一个大文件(任何类型)并将其拆分成许多较小的"块".我认为我有基本的想法,但由于某种原因,我无法创建超过12 kb的块大小.我知道谷歌等有一些解决方案,但我更感兴趣的是了解这个限制的起源是什么,然后实际上使用该程序来分割文件.
//This file splits are larger into smaller files of a user inputted size.
#include<iostream>
#include<fstream>
#include<string>
#include<sstream>
#include <direct.h>
#include <stdlib.h>
using namespace std;
void GetCurrentPath(char* buffer)
{
_getcwd(buffer, _MAX_PATH);
}
int main()
{
// use the function to get the path
char CurrentPath[_MAX_PATH];
GetCurrentPath(CurrentPath);//Get the current directory (used for displaying output)
fstream bigFile;
string filename;
int partsize;
cout << "Enter a file name: ";
cin >> filename; //Recieve target file
cout << "Enter the number of bites …Run Code Online (Sandbox Code Playgroud)