History ------- ------------------- ««« Sploin 1.79 »»» ------------------- - Yves Perrenoud -- - 02.09.1994 ------ ------------------- ------------------------------------------------------------------------------ - V1.0 : Base version, which only lets you extract and not really split, - - no bugs found. - ------------------------------------------------------------------------------ - V1.1 : Added the option to split the file in x parts of a size - - specified by the user, or in a specified number of parts. - ------------------------------------------------------------------------------ - V1.2 : Added multi file join. - ------------------------------------------------------------------------------ - V1.3 : Added an option which tells Sploin to use an input file - - containing the names of files to join together. Removed a few - - little bugs. - ------------------------------------------------------------------------------ - V1.4 : Wildcards are now supported. You can specify an destination dir. - - when splitting in several parts. - ------------------------------------------------------------------------------ - V1.45 : Fixed an ugly bug which didn't accept subdirectories in the - - original path when using the -d option. - ------------------------------------------------------------------------------ - V1.5 : Changed the program so it would no longer use the arp library - - for pattern matching and for break detection, but DICE routines - - instead. Also changed everything to Ansi-C (increased the binary - - by 6k). Removed stupid options. Found bugs in the removed - - options (Hey hey!) - ------------------------------------------------------------------------------ - V1.6 : Added an option to reconstruct a previously split file. - - Corrected a bug in the input file option. Can now be compiled - - under UNIX. - ------------------------------------------------------------------------------ - V1.61 : Fixed an Enforcer hit! - ------------------------------------------------------------------------------ - V1.62 : Changed the spliting size character from "$" to "=". The dollar - - sign is used by UNIX for specifying things like the last word - - on the previous line ("!$"). Due to this, on UNIX the program - - wouldn't split big files in smaller files of a specified size; - - which is my main use of the program. - ------------------------------------------------------------------------------ - V1.65 : Removed a bug which didn't set the right protections on the - - created files under UNIX. Added VAX/VMS compatibility, but - - without wildcard support (until I find out how it works). - ------------------------------------------------------------------------------ - V1.70 : Added the "-m{l|h}" feature to greatly ease the transport on - - MS-DOS format disks by setting default sizes and truncating - - filenames to 8.3 chars when using the multiple file split/join - - options. Added the ']' in StripPath for VMS support. - ------------------------------------------------------------------------------ - V1.76 : Added VMS wildcard support thanks to some source code written by - - Karl-Jose Filler. Now asks the user for confirmation if the - - number of chunks exceeds 150. Converts filenames to lowercase - - when using MS-DOS 8.3 format (apparently caused problems). Fixed - - a bug which caused VMS overwrites to simply go to void. - ------------------------------------------------------------------------------ - V1.78 : Changed the syntax of the multiple files spliting from "-sN" - - where N is the number of parts to "-pN", and "-s=N" where N is - - the size of each part to "-sN". The program complains if "-s=" - - is used. Fixed a bug which could cause a division by zero. - - Complains if the buffer size is set to zero. Displays a warning - - if the size to extract is set to zero. - ------------------------------------------------------------------------------ - V1.79 : Fixed a problem on VMS introduced with the wildcard support, the - - filename of a non existing file had a ";" appended so the "-g" - - option never found anything to open. - ------------------------------------------------------------------------------ Sploin Version 1.79 Written by Yves Perrenoud Copyright (c) 1991-94 All Rights Reserved. Disclaimer : ------------ I am NOT responsible for anything this program does; you are using it enterily at your own risk. This program is freely distributable for non-commercial use, provided a small credit note or a thank-you is included in the readme file. The source file is not to be modified without the permission of the author. It is only distributed so the program can be compiled on the UNIX and VMS operating systems. Description : ------------- This program lets you split a file in several different ways or join several files together. So here is a descripiton of the spliting facility : - You can extract a specified amount of bytes anywhere in a file and optionaly save what rests. - Split a file in two parts and only specify the size of the first chunk. - Extract a certain amount of bytes from the beginning of the file. - Split a file in a certain amount of parts or in chunks of a specified size. The resulting files will have the "_n" extension added to the original name. - Optionnaly follow MS-DOS 8.3 characters limitation when splitting in multiple parts (giving the most appropriate name possible) and set the size of a chunk according to the density of the disk (DD or HD). And here is a description of the joining facility : - You can join several files together, just like the command "join". Of course wildcards are supported. - Use an input file to specify the files to join together. This lets you join an ilimited number of files together, or use the output of another program to prepare a list of files (i.e. list, ARexx, etc..). - You can reconstruct a file which was previously split with Sploin. Let me get this clearer: you have FTPed a big archive (2.5Mb), and you want to bring it back to your Amiga at home. Well you split the file in chunks of 700'000 bytes, transfer them to disk, and then when you get home, you reconstruct the archive with Sploin using the "-g" option. - When reconstructing ("-g"), automatically detects if the multiple files are in normal format or in the MS-DOS 8.3 chars one. Detailled description : ----------------------- The command is invoked as follows : Sploin {} [] , is the file you will be spliting or the joined file. The fact it must be the first filename on the command line is quite obvious when you use the split option, but when joining this can be at first a bit confusing; it's just a question of habit. {}, are either the files you are going to join, in which case you are only limited by the length of the command line, or the resulting files from the split. Wildcards are supported. [], here is a list of them : The mode you are going to use : -j : join mode (default). -sX : split mode (optional chunk size). -pY : split mode (optional number of chunks). The actual options : -b : buffer size. -o : offset (split only). -n : size to split in bytes (split only). -r : save rest (split only). -i : input file. -g : reconstruct mode, opposite of -sN (join only). -d : destination directory (split only). -m{l|h} : truncate to 8.3 chars MS-DOS format and sets a chunk size suitable for DD (l) or HD (h). Spliting files : ---------------- Buffering : With "-b" followed by a value in bytes, you will set the buffer to the desired size. The default size is 50'000 bytes. Exctracting : "-n" : specifies the amount of bytes to exctract. "-o" : is the offset at which the program should start exctracting. "-r" : is an option which will save what is rest of the file after the exctraction. So lets say you want to strip the first 2000 bytes of a file called "Filename" into a destination file called "DestFile", you would type : "Sploin -s Filename DestFile -n2000". Now, you want to extract from a sample which is 1.5mb long, 450'000 bytes starting at the 800'000th byte. You simply type : "Sploin Sample Speech -s -n450000 -o800000". Next, you want to separate the sample in two chunks : one of 76'000 bytes and the rest which is (1.5mb - 76'000) 972'576; you type : "Sploin Sample -s -n76000 -r Introduction MainSequence" And finaly, you have a file which is 32000 bytes long, you want to extract 5'000 from the 12'000th byte and save the 15'000 remaining, you type : "Sploin -s Messages.txt -n5000 -r Description.txt -o12000 Details" Note : When you are doing traditional spliting, it doesn't make any ---- diffference wether you use -s or -p. Both have exactly the same meaning! Spliting files in several parts : --------------------------------- For this you either use "-s" followed by the size of the smaller files you want to output, or "-p" followed by the number of parts the file should be splited in. A "_n" extension will be added to the name of the file you are spliting for each splited file. If you don't want the files saved to the same directory as the original file's, use the "-d" option. Spliting a file called "Garfield.IFF" which is 83'237 bytes long into 5 different files will be done as follows : "Sploin -p5 Garfield.IFF" "Garfield.IFF" 83'237 bytes ---> "Garfield.IFF_1" 16'648 bytes "Garfield.IFF_2" 16'648 bytes "Garfield.IFF_3" 16'648 bytes "Garfield.IFF_4" 16'648 bytes "Garfield.IFF_5" 16'645 bytes Spliting a file called "Sample" which is 3'000'000 bytes long on the volume dh0: into several chunks of 850'000 bytes long on the volume dh1: "Sploin dh0:Sample -s850000 -ddh1:" Volume dh0: Volume dh1: "Sample" 3'000'000 bytes ---> "Sample_1" 850'000 bytes "Sample_2" 850'000 bytes "Sample_3" 850'000 bytes "Sample_4" 450'000 bytes Note : On UNIX, replace "dh0:" by "/" and "dh1:" by "~/"; on VMS ---- replace the "dh0:" by "sys$login:" and "dh1:" by "[.test]" for instance. If the files are to be transfered on an MS-DOS format disk, you can use the "-m{l|h}" option where the "l" and "h" respectively specify a chunk size suitable to fit on a Double Density (720 KB) or a High Density (1.44 MB) disk (if neither "l" nor "h" were used, "l" is taken by default). Using this option will tell Sploin only to create files with a filename of maximum 8 characters and an extension (if any) of 3. For example, let's say you want to split the file "Mosaic.backup" to fit on a 720K disk, you will get several (depending on the size of the main file) "Mosaic_1.bac", "Mosaic_2.bac", ... , "Mosai_15.bac", etc... This is a perfect example of the use of Sploin, divide a huge file in a certain number of smaller files which will fit on a disk. You can then reassemble the smaller files into the huge file automatically using the join "-g" option (see example below). Joining files together : ------------------------ When you are in join mode, the only options availiable are "-b -i -g". To join several files together you simply type Sploin followed by the name of the destination file, and then you type the name of the different files you which to join together. there must be at least one file, in which case Sploin will simply copy the file. Note : If a file which will be created with Sploin already exists, the ---- program will ask you for a confirmation before replacing the file. Here is an example of a join : Sploin messages_1_250 messages_1_119 messages_120_250 or Sploin -j messages_1_250 messages_1_119 messages_120_250 The two are exactly the same since the "-j" is the default. Now a multiple file join : Sploin 4Months January February March April Would join January, February, March and April as 4Months. An other example, we want to join all the files ending in ".txt" : Sploin all.txt #?.txt (AmigaDOS) Sploin all.txt *.txt (UNIX & VMS) An input file can be specified with "-i", which will contain the names of the files to join. This lets you have an ilimited number of files to join togeter, because with a program like join, if you have more files than the command line, you must proceed in several passes. An interesting thing about this option is you can redirect the output of a program like list (ls on UNIX or "dir /output=..." on VMS), or use a script (ARexx on the Amiga) to specify the file names. Here is an example : you wich to join all the files with the .c suffix together in a file called "all.c" (this is the same as the previous example). List #?.c lformat "%s" >ram:files then you invoke Sploin : (AmigaDOS) Sploin all.c -iram:files ls *.c > ~/files then you invoke Sploin : (UNIX) Sploin all.c -i~/files Reconstruction mode : --------------------- To reconstruct a file you use the "-g" option. This is the opposite of "-sX and -pY". This means you join all the files which match "_n", where is the file to be reconstructed. You might ask, "but why use -g when you can use wildcards?". The answer is quite simple, with wildcards you are not guarented the files will be in the right order! Here is an example : you want to reassemble an previously split archive. "Sploin Radiance.lzh -g" "Radiance.lzh_1" 700'000 bytes ---> "Radiance.lzh" 2'723'467 bytes "Radiance.lzh_2" 700'000 bytes "Radiance.lzh_3" 700'000 bytes "Radiance.lzh_4" 623'467 bytes Note : Sploin will automatically try and open the file which would have ---- been created with the "-m{l|h}" option at splitting time. In other words, wether you used "-sX, -pY or -m{l|h}" when splitting, you don't have to bother with anything, you just type "-g" as usual to reconstruct, whatever filename standard was used. Future enhancements : --------------------- - Add an option to specify a format string for the multiple files names. - Enable the extended GNU parameter passing syntax : "-o" = "--offset". - Optimize VMS open flags :-( or distribute the binary compiled with VMS GCC... whatever - Strip all non uuencoded, VMS shared, shiped, etc... code from file(s) and create one file ready to be decoded. User feedback : --------------- At the moment, I use a 728000 bytes chunk when the destination disk is a Double Density (720K) disk. Although theoretically the amount of space available is 737280 bytes, it seems that practically it's just over 730000 bytes, so I chose 7.28E5 just to make sure it would always fit. Now when it comes to HD disks (1.44 MB), since I don't use them all that much, I simply decided to use twice the amount that I use for a DD (fingers crossed ;-). If you encounter problems with these values, or you have more precise ones than I use, please send me some kind of mail (see below). Conclusion : ------------ The program was developed on an Amiga 3000 with 4mb of RAM and tested on a non accelerated Amiga 2000 with 5mb of RAM and 512k of chip. The program was also tested on Sun Sparc 1, running SunOS 4.1.2; Amiga 3000UX running Amix; VAX VMS version 5.5-2; MIPS running RISC/os 5.1; several other UNIX systems. Well this is just about it, I don't know what else I could say about the program. If you have any suggestions, ideas or simply if you find a bug, contact me in one of the ways decribed below. If you like this program or find it useful, you could send me a postcard or something so I'll know where my program is being used (please do :-). - The BBSs I use the most frequently (every 2 weeks) : AUGS : +41 62 4 327 Temptation : +41 38 55 34 54 I will be under Yves Perrenoud or pyves. - On Fidonet 2:301/315.50 (pyves) - InterNet : pyves@nuga.alphanet.ch pyves@neli00.eicn.etna.ch Yves.Perrenoud@eicn.etna.ch pyves@litamiga.epfl.ch - X.400 : C=ch; A=arcom; P=switch; O=etna; OU=eicn; S=Perrenoud; G=Yves - VAX MAIL : 53848::PYVES The "@nuga..." address is my home machine, so it might take maximum a day or two to reach me, but it'll definitely reach me. The "@neli00..." is the fastest way to reach me (except on week-ends) and if I'm currently logged on, you can get an answer in a few minutes. Still, if there isn't any hurry, my home machine address is the prefered. BTW, the @neli00 and the VAX Mail address is on my side exactly the same, so just choose whatever you have access to. You can of course send me normal mail (or a postcard ;-), see the address below. Yves Perrenoud, Traversière 29, CH-2013 Colombier, Switzerland.