Page 1 of 1

splitting files with c / c++

Posted: Mon May 16, 2005 1:50 am
by theshadguy
I know this really isnt homebrew, but its still dev related...

Does anyone know how to split up large files into multiple pieces? That is, I'm writing a program, and I have some lage files that need to be chopped up into smaller pieces. does anyone know how to do this? or any libs out there that may help me?

Thanks a bunch

J

Posted: Mon May 16, 2005 1:59 am
by Drakonite
Read a chunk from the source file.
Write the chunk to a dest file.
Read another chunk from the source file
Write the chunk to a different dest file.
Lather, rinse, repeat.

Posted: Mon May 16, 2005 3:06 am
by Thanhda
go to gamedev.net

Posted: Mon May 16, 2005 3:39 am
by boomint
Thanhda wrote:go to gamedev.net
What on earth has gamedev.net got to do with splitting a file into abitrary sized chunks?

This is just common sense, logical, "how do I solve a problem?" thinking... ahem.

Posted: Mon May 16, 2005 3:48 am
by Thanhda
boomint wrote:
Thanhda wrote:go to gamedev.net
What on earth has gamedev.net got to do with splitting a file into abitrary sized chunks?

This is just common sense, logical, "how do I solve a problem?" thinking... ahem.
well whenever i have a question that isnt psp/ps2 related but programming related i ask people at gamedev.net. since its erelevent to this homebrew comunity.

Posted: Mon May 16, 2005 4:05 am
by Guest
If you are on unix, there is the "split" command.

If you are on unix, I assume you know how to lookup how to use it.

Posted: Mon May 16, 2005 10:06 am
by theshadguy
haha well im only on unix (Linux) every once in a while, and yes I know how to look it up, but I'm not writing for linux at the moment