home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 9
/
FreshFishVol9-CD2.bin
/
bbs
/
util
/
filechop-1.0.lha
/
FileChop
/
FileChop.doc
< prev
next >
Wrap
Text File
|
1994-02-27
|
3KB
|
74 lines
FileChop
by Charles Pham
A while back I ran into a "large" problem. This problem consisted
of a 1.5 meg file taking up space on my hard drive. I didn't want to
delete it, but I wanted to get it off of the hard drive because it
was so big. Unfortunately, even after using a file compressor, it
still wouldn't fit on a floppy disk.
It occurred to me that if this file could be split in two, each
half would easily fit on a floppy, compressed or not. It should be a
mind-bendingly simple task to write a program that could do this.
So...
Using FileChop is easy. Just type "filechop <filename>
[>savepath]". The program's default mode is to automatically split
the file into two chunks (named "CHUNK01.<filename>" and
"CHUNK02.<filename>") and store them in the savepath (or the current
directory, if no savepath is specified).
Typing "filechop -sY <filename> [>savepath]" will create chunks
that are Y bytes long or shorter. This is useful for a
multi-megabyte file that needs to be fit onto floppies; using a
value of 840000 should do the trick. The number of chunk files
created will be determined by the given size divided by the main
file's size. If the number of chunks would be more than 32, you will
have to give a larger value for Y.
Example: FileChop -s6000 dh1:cfiles/MyFile.c >ram:
If you want more than two chunks, type "filechop -nX <filename>
[>savepath]", where X is the number of chunks to create. The maximum
value for X is 32.
Example: FileChop -n16 dh0:mystuff/MyFile.txt >dh1:t
To glue the chunks back together again, put them all in the
same directory and type "filechop -g <filename> [>savepath]".
ex: FileChop -g MyFile
FileChop stores information about the number of chunks and their
length in the chunk files themselves. You'll be warned if the chunk
files appear to be too long or too short.
CAVEATS: The ">" is required if you want to specify a save path.
Do not include the file name with the save path. The file name
is the same for the main file and chunk files and cannot be
different. If you want to change the file names, use the DOS
command Rename.
When gluing a file back together again, DO NOT put "CHUNKxx." in
front of the file name. Just give the file name after the
"CHUNKxx."
Try not to use very long file names as DOS will truncate file
names at 30 characters.
Technical information: chunk file header format (20 bytes):
LONG "FILE","CHOP" ;identification tags
WORD chunk # ;this is chunk #: 1 - 32
WORD total chunks ;how many chunks were created? 2 - 32
LONG this chunk's size ;how big was this chunk?
LONG original file's size ;total bytes in main file
Comments? Questions? DONATIONS? ;)
Leave "Psyche-borg" a message at
Tycho's Computer Express: (310) 493-6402 in La Mirada, CA
OR Write to --> Charles Pham
5947 Noumea
Cypress, CA, 90630