I want to know how I can make a prog that can split files (mp3 for example) into small parts,
wich can than be put on floppy for example, and later restored with another program (or the same).
TIA,
(:. Jop .:)
Printable View
I want to know how I can make a prog that can split files (mp3 for example) into small parts,
wich can than be put on floppy for example, and later restored with another program (or the same).
TIA,
(:. Jop .:)
Of course you can. But i would prefer zipping them.
Just open you file in binary and make a loop fill a buffer with next amount of characters in a string with Get statement. Then open another file in binary ie: thefirstfilename & index. And put the string into it, and then make make the loop go while raising index until you've got eof.
Erm... I know I'm stupid, but what's the index? an integer?
Like
[code]
Do
Open File For Binary Acces Write As fn '(is this right?)
Get fn, NR of LINES, INTOstring '(and this, is this right?)
Close fn
Open FILE2 For Binary ...
Put ...
Close ...
Open FILE3 For ...
Put ...
Close ...
But where do I have to put that Index thingy?
Thanks Kedaman, you're a real help for me and lots of others here I think!
Jop
The index he is talking about is the loop variable which is being used in the get statement as the file postion pointer.
Look up get and put in msdn under the file method binary and you'll see.
Get #1, Index, Var
It's worth buffering. eg don't loop and get one byte at a time because it'll slow it down. If you're after 1.4mb then grab 1.4 mb at a time (I wouldn't recommend much more than that though) (by Dim'ing the array to that size. the get and put will only use as much data as the array size.
Or, if memory is not an issue, grab the whole file and put it into pieces.
I hope this makes sense (it's early here)