Home > database >  Is it possible to split one large file into n files without copying?
Is it possible to split one large file into n files without copying?

Time:02-12

Is it possible to split one large file into n files without copying ?

Ex. We have a large 1000 MB file and we want to spit these into say 10 individual files of 100 MB each.

The only way I know is to create 10 new files and copy from the large file given starting and ending position of each individual file.

Is it possible to achieve it without employing copying ?

CodePudding user response:

I'd say it's impossible without copying. File data are (for files larger than one MFT record, which 100 MB file usually is) are located in clusters. Let's say you have a 5000 bytes long file that occupies 3 clusters, where 1 cluster is 2048 bytes long - and you want to split it into two files. Then you'll need to use 4 clusters and copy data from second and third cluster, and that's bare minimum of R/W operations, usually you'll need to read these three clusters and write four clusters.

  • Related