home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / mods / makers / symd1.lha / Split.doc < prev    next >
Encoding:
Text File  |  1980-01-16  |  9.8 KB  |  287 lines

  1.  
  2.     Historique
  3.     ----------
  4.  
  5.  
  6. ------------------
  7. «««« Split 1.2 »»»
  8. ------------------
  9. - Yves Perrenoud -
  10. - 10.09.1991 -----
  11. ------------------
  12.  
  13.  
  14. ------------------------------------------------------------------------------
  15. -  V1.0  :  Base version, which only lets you extract and not realy split,   -
  16. -           no bugs found.                                                   -
  17. ------------------------------------------------------------------------------
  18. -  V1.1  :  Added the option to split the file in x parts of a size          -
  19. -           specified by the user, or in a specified number of parts.        -
  20. ------------------------------------------------------------------------------
  21. -  V1.2  :  Added multi file join.                                           -
  22. ------------------------------------------------------------------------------
  23.  
  24.  
  25.  
  26.                               Split Version 1.2
  27.                           Written by Yves Perrenoud
  28.                                Copyright © 1991
  29.                              All Rights Reserved.
  30.  
  31.  
  32.  
  33.  
  34.     Disclaimer :
  35.     ------------
  36.  
  37.     I am NOT responsible for anything this program does; you are using it
  38.     enterily at your own risk.
  39.  
  40.     This program is freely distributable for non-commercial use, provided a
  41.     small credit note or a thank-you is included in the readme file.
  42.  
  43.     Description :
  44.     -------------
  45.  
  46.     This program lets you split a file in several different ways or join
  47.     several files together.
  48.  
  49.     The spliting part of the program is, as the title expresses, the main
  50.     reason for which I wrote this. So all the aims I had previously fixed
  51.     myself are now implemented. This is not the case for the join part,
  52.     which still lacks a couple of options (see future enhancements). So
  53.     here is a descripiton of the spliting facility, or should I say
  54.     extracting :
  55.  
  56.     - You can extract a specified amount of bytes anywhere in a file and
  57.       optionaly save what rests.
  58.     
  59.     - Split a file in two parts and only specify the size of the first
  60.       chunk.
  61.     
  62.     - Extract a certain amount of bytes from the beginning of the file.
  63.     
  64.     - Split a file in a certain amount of parts or in chunks of a
  65.       specified size. The resulting files will have the "_n" extension
  66.       added to the original name.
  67.  
  68.     The joining part is simply a case of joining multiple files together,
  69.     just like the cli command "join". Special features will be added in a
  70.     future release.
  71.  
  72.  
  73.     Detailled description :
  74.     -----------------------
  75.     
  76.     The command is invoked as follows :
  77.     
  78.         Split <Mainfile> {<FileN>} [<options>]
  79.     
  80.     <Mainfile>, is the file you will be spliting or the joined file. The
  81.     fact it must be the first filename on the command line is quite obvious
  82.     when you use the split option, but when joining this can be at first a
  83.     bit confusing; it's just a question of habit.
  84.  
  85.     {<FileN>}, are either the files you are going to join, in which case
  86.     you are only limited by the length of the command line, or the
  87.     resulting files from the split.
  88.  
  89.     [<options>], here is a list of them :
  90.  
  91.     
  92.         The mode you are going to use :
  93.  
  94.             -j      : join mode (default).
  95.             -sN     : split mode.
  96.  
  97.         The actual options :
  98.  
  99.             -a      : maximum buffer.
  100.             -b      : buffer size.
  101.             -o      : offset (split only).
  102.             -n      : size to split in bytes (split only).
  103.             -r      : save rest (split only).
  104.             -l      : largest buffer.
  105.  
  106.  
  107.     Joining files together :
  108.     ------------------------
  109.  
  110.     When you are in join mode, the only options availiable are "-a -b -l".
  111.     In fact the -a and -l, will have the same effect (which is not the case
  112.     in the split mode) : They will use a buffer which is equal to the
  113.     largest block of memory availiable. To be honest I don't see why this
  114.     option could be of any use to someone, but there you are it's in the
  115.     program. It could maybe speed up things a little when working on big
  116.     files.
  117.  
  118.     Of course the -b option is to set the buffer to a specific size, the
  119.     default value is 50'000 bytes. To join several files together you
  120.     simply type split followed by the name of the destination file, and
  121.     then you type the name of the different files you which to join
  122.     together. there must be at least one file, in which case split will
  123.     simply copy the file.
  124.  
  125.     Note : If a file which will be created with split already exists, the
  126.     ----   program will ask you for a confirmation before replacing the
  127.            file.
  128.  
  129.     Here is an example of a join :
  130.     
  131.         Split messages_1_250 messages_1_119 messages_120_250
  132.         
  133.         or
  134.         
  135.         Split -j messages_1_250 messages_1_119 messages_120_250
  136.  
  137.     The two are exactly the same since the "-j" is the default. Now a
  138.     multiple file join :
  139.  
  140.         Split 4Months January February March April
  141.     
  142.     Would join January, February, March and April as 4Months.
  143.     
  144.     
  145.     
  146.     Spliting files :
  147.     ----------------
  148.     
  149.     In this mode all the options are used, and for different reasons, so
  150.     "-a" and "-l" concern different things.
  151.  
  152.  
  153.     Buffering :
  154.     
  155.     With "-b" followed by a value in bytes, you will set the buffer to the
  156.     desired size.
  157.     
  158.     If you use "-a", which sets the buffer to the size of the program to
  159.     split (so everything will be done in one pass), and there isn't enough
  160.     memory, the program will warn you of so and advise you to use the "-l"
  161.     option. This options if set in conjunction with "-a", only if there
  162.     isn't enough memory, will set the buffer to the largest block of
  163.     memory. For this you must have the "-l" and "-a" present at the same
  164.     time. If there is only "-l", it will simply be ignored.
  165.  
  166.     Note : If you are joining, you don't have to put them both; one of the
  167.     ----   two will be enough.
  168.  
  169.  
  170.     Exctracting :
  171.     
  172.     "-n" : specifies the amount of bytes to exctract.
  173.     "-o" : is the offset at which the program should start exctracting.
  174.     "-r" : is an option which will save what is rest of the file after the
  175.            exctraction.
  176.  
  177.     So lets say you want to strip the first 2000 bytes of a file called
  178.     "Filename" into a destination file called "DestFile", you would type :
  179.  
  180.     "Split -s Filename DestFile -n2000".
  181.     
  182.  
  183.     Now, you want to extract from a sample which is 1.5mb long, 450'000
  184.     bytes starting at the 800'000th byte. You simply type :
  185.  
  186.     "Split Sample Speech -s -n450000 -o800000".
  187.     
  188.     
  189.     Next, you want to separate the sample in two chunks : one of 76'000
  190.     bytes and the rest which is (1.5mb - 76'000) 972'576; you type :
  191.  
  192.     "Split Sample -s -n76000 -r Introduction MainSequence"
  193.     
  194.     
  195.     And finaly, you have a file which is 32000 bytes long, you want to
  196.     extract 5'000 from the 12'000th byte and save the 15'000 remaining,
  197.     you type :
  198.  
  199.     "Split -s Messages.txt -n5000 -r Description.txt -o12000 Details"
  200.     
  201.     
  202.     
  203.     Spliting files in several parts :
  204.     ---------------------------------
  205.     
  206.     For this you, use the -sN option, where N is either the amount of
  207.     smaller files you want to output or if you add a '#' it will be the
  208.     size of the different files. A "_n" extension will be added the name of
  209.     the file you are spliting for each splited file.
  210.  
  211.     
  212.     Spliting a file called "Garfield.IFF" which is 83'237 bytes long into 5
  213.     different files will be done as follows :
  214.  
  215.     "Split -s5 Garfield.IFF"
  216.     
  217.     "Garfield.IFF"  83'237 bytes   --->   "Garfield.IFF_1"  16'648 bytes
  218.                                           "Garfield.IFF_2"  16'648 bytes
  219.                                           "Garfield.IFF_3"  16'648 bytes
  220.                                           "Garfield.IFF_4"  16'648 bytes
  221.                                           "Garfield.IFF_5"  16'645 bytes
  222.  
  223.     Spliting a file called "Sample" which is 3'000'000 bytes long into
  224.     several chunks of 850'000 bytes long :
  225.  
  226.     "Split Sample -s#850000"
  227.     
  228.     "Sample"  3'000'000 bytes      --->    "Sample_1"  850'000 bytes
  229.                                            "Sample_2"  850'000 bytes
  230.                                            "Sample_3"  850'000 bytes
  231.                                            "Sample_4"  450'000 bytes
  232.  
  233.     This is a perfect example of the use of split, divide a huge file in a
  234.     certain number of smaller files which will fit on a disk.
  235.  
  236.     
  237.     Conclusion :
  238.     ------------
  239.     
  240.     Well this is just about it, I don't know what else I could say about
  241.     the program. If you have any suggestions, ideas or simply if you find a
  242.     bug, contact me in one of the ways decribed below. If you like this
  243.     program or find it useful, you could send me a postcard or something so
  244.     I'll know where my program is being used.
  245.  
  246.  
  247.     - The BBSs I use the most frequently :
  248.  
  249.         ACCU  : +41  1 860 8913
  250.         AUGL  : +41 75 2 1587
  251.         AUGS  : +41 62 4 327
  252.         MAGIC : +41 61 98 6843
  253.  
  254.     I will be under Yves Perrenoud or YPerrenoud (AUGS).
  255.  
  256.     - On Fidonet 2:302/906 (Yves Perrenoud)
  257.  
  258.     - USENET : pyves@alphanet.imp.com
  259.  
  260.  
  261.  
  262.     If you don't live in Switzerland, I advise that you use Fidonet to
  263.     contact me or eventually Usenet. Otherwise leave me a message on AUGL
  264.     (Yves Perrenoud), MAGIC (Yves Perrenoud) or one of the BBSs mentionned
  265.     above. Of course you can send me normal mail, see the address below.
  266.  
  267.  
  268.         Yves Perrenoud,
  269.         Traversière 29,
  270.         CH-2013 Colombier,
  271.         Switzerland.
  272.  
  273.  
  274.  
  275.     Future enhancements :
  276.     ---------------------
  277.  
  278.     - Wild card support (for the join part).
  279.     
  280.     - Using a file containing the names of the different files you want to
  281.       join instead of having to type them on the command line. The
  282.       advantage is you're not limited by the length of the command line,
  283.       and also you can use an output from an other program; for example
  284.       list (with the lformat facility).
  285.  
  286.     - Reducing the size of the executable.
  287.