splitting files with c / c++

General, off-topic discussion about things of interest to the members of these forums.

Moderator: cheriff

Post Reply
theshadguy
Posts: 12
Joined: Thu Nov 04, 2004 8:08 am

splitting files with c / c++

Post 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
User avatar
Drakonite
Site Admin
Posts: 990
Joined: Sat Jan 17, 2004 1:30 am
Contact:

Post 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.
Shoot Pixels Not People!
Makeshift Development
User avatar
Thanhda
Posts: 331
Joined: Sat Apr 09, 2005 2:08 am
Location: Canada
Contact:

Post by Thanhda »

go to gamedev.net
There are 10 types of people in the world: Those who understand binary, and those who don't...
boomint
Posts: 80
Joined: Tue Apr 13, 2004 2:21 am
Location: Sheffield, UK

Post 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.
--( someone stole my sig! )--
User avatar
Thanhda
Posts: 331
Joined: Sat Apr 09, 2005 2:08 am
Location: Canada
Contact:

Post 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.
There are 10 types of people in the world: Those who understand binary, and those who don't...
Guest

Post 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.
theshadguy
Posts: 12
Joined: Thu Nov 04, 2004 8:08 am

Post 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
Post Reply