home *** CD-ROM | disk | FTP | other *** search
/ Micro R&D 1 / MicroRD-CD-ROM-Vol1-1994.iso / os20 / cli / randomcopy.lha / randomcopy.doc next >
Encoding:
Text File  |  1993-12-23  |  6.3 KB  |  174 lines

  1.  
  2.  
  3.                              Randomcopy  V0.5
  4.  
  5. 1. Disclaimer.  READ FIRST!
  6.  
  7.     The author of this program, randomcopy, cannot be held responsible for
  8.   any damage caused, either direct or indirect, to any files, programs, or
  9.   hardware resulting from proper,improper, or normal usage.  Use at your
  10.   own risk.
  11.  
  12.     Randomcopy, including all executables and source, is ® Copyright 1993
  13.   by Chad Randall and mbissaymssik software.  This program is not shareware,
  14.   but is FREEWARE.  You needn't pay a dime to use, it's free.  This means it's
  15.   free to everyone, and you may not charge any money for it (sell it).  This
  16.   right is reserved by the author.  You may, of course, charge for duplication
  17.   fees, storage media, or shipping charges.
  18.  
  19.     Commercial distribution is prohibited.  If you feel you company would like
  20.   to include this file with your product, you may contact the author.
  21.  
  22.  
  23. 2. Copyright notice.
  24.  
  25.     Once again, this program, including all binaries, text, and source is;
  26.  
  27.          ® Copyright 1993 by Chad Randall and mbissaymssik software.
  28.  
  29.                           All rights reserved.
  30.  
  31.  
  32. 3. Introduction
  33.  
  34.     Workbench 2.x or higher is required.  If you do not have 2.x yet, I strongly
  35.   suggest you run out and get it.  Or better, get an A1200.  It's quite nice.
  36.  
  37.     Randomcopy is a small CLI interface run command.  It accepts a wildcard
  38.   pattern for a source and a filename for a destination.
  39.  
  40.   Example:  randomcopy FROM PREFS:presets/patterns/#? TO env:sys/wbpattern.prefs
  41.  
  42.     Randomcopy will scan the directory at PREFS:presets/patterns for any files.
  43.   It will choose one at random and copy it into the file env:sys/wbpattern.prefs.
  44.  
  45.  
  46. 4. Why use it?
  47.  
  48.     I had a bunch of workbench backdrop pictures on my 1200 and wanted to be able
  49.   to have one choosen at random at bootup.  I thought of many ways of doing it.
  50.   I believed others might want random pointers, palettes, etc.  Then I thought
  51.   that there might be other usages for it too (send me ideas!).
  52.     Of course, the main reason I can see to use it is to have a random pref file
  53.   each time you reboot.  This is the main reason to use it as of now.
  54.  
  55.     An AREXX script could probably be written to do basically the same function
  56.   as this program.  But isn't it easier just to download this small file from
  57.   Aminet?  And how many people *really* know AREXX?  I don't..
  58.  
  59.  
  60. 5. Usage
  61.  
  62.     To run the program, it must be done from the CLI.  No wbinterface is
  63.   included.  It has to be given a minimum of two parameters, similar to the CLI
  64.   COPY command.
  65.  
  66.    randomcopy FROM/A sourcepattern TO/A destinationfile QUIET/S CLONE/S ABOUT/S
  67.  
  68.     The FROM keyword is optional.  If it isn't present, the first argument
  69.   encountered will be the source.  Same with the TO keyword.
  70.  
  71.     The sourcepattern argument is just that, a pattern.  Of course, this might
  72.   be a filename.  A filename is a pattern, but of course, there will be no
  73.   randomness about it.  It will happily copy the file.
  74.  
  75.     The destination argument must include a filename.  You can't copy to a
  76.   directory name only. This may be changed in future releases.
  77.  
  78.     The QUIET switch supressed any console output.  This is useful for scripts,
  79.   mainly the startup-sequence.
  80.  
  81.     The CLONE switch is not implemented as of yet, and is basically ignored.
  82.  
  83.     The ABOUT switch will print (if QUIET is not present) some information
  84.   about the program, and will give some addresses.
  85.  
  86.     The file includes a $VER string, which can use the command version to read.
  87.  
  88. 6. Examples
  89.  
  90.     Having a directory full of small text files, each containing a small fortune
  91.   cookie message.  Just use:
  92.  
  93.     randomcopy cookies:#?.txt ram:yourfortune
  94.     type ram:yourfortune
  95.  
  96.     This will copy a file from a list of matching filenames to the RAM drive.
  97.   Then the message is printed to the console window.
  98.  
  99.  
  100.     But for a more impressive result:
  101.   
  102.     randomcopy pictures:(#?man#?|#?dog#?) ram:showme.pic
  103.     viewpic ram:showme.pic
  104.     delete ram:showme.pic
  105.  
  106.     This will select a pic with either "man" or "dog" in it's name from the
  107.   directory pictures.  Then of course, the selected picuture is displayed.  And
  108.   finally the picture is deleted.
  109.  
  110.     When you run workbench, usually (hopefully), a small daemon called IPrefs
  111.   is run also.  This program checks for alterations to any preference file stored
  112.   in ENV:.  You could then run this program at any time to randomly copy a file
  113.   from a set of presets into it's matching env:sys/ counterpart and have the
  114.   modifications take place automatically.  Include a oneliner in the
  115.   shell-startup script, and every time a new shell starts you could have your
  116.   window patterns or your pointer change.
  117.  
  118. 7. Tips
  119.  
  120.     Of course, you would not want to copy an .info file.  Just use the power
  121.   of OS 2.x pattern matching:
  122.  
  123.     randomcopy PREFS:presets/patterns/#?~(#?.info) ENV:sys/wbpattern.prefs
  124.  
  125.     This will exclude any info files, so you could still use workbench to move,
  126.   modify, or update your preset settings.
  127.  
  128.     Use your imagination!
  129.  
  130.  
  131. 8. Contacts for info or bug reports.
  132.  
  133.     This is my first semi-finished project.  Of course it one of the smaller
  134.   ones, too.  But I'm sure there are many bugs still in the code.
  135.  
  136.     You can send me EMail at crandall@garnet.msen.com
  137.  
  138.     I would really appreciate any comments; good, bad or the ugly.  Even flames.
  139.  
  140.     If you live in timbuktu and don't have Internet access (poor, poor thing.)
  141.   you can send USNAIL to me at  229 S.Washington St, Manchester, MI  48158-9680
  142.   This is in the US of course.
  143.  
  144.  
  145. 9. Plans, notes, and bugs.
  146.  
  147.     There are many things I can do to this program given some more time.
  148.   This includes:
  149.  
  150.   o Activating the CLONE feature.  I don't know why I put it in, really.
  151.  
  152.   o Adding a random or set time feature.  You could give the program a range
  153.     and it would copy the file.  You could have a different picture every
  154.     15 minutes or so.  This would work in a script for a slideshow effect, also.
  155.     I had orginally planned this, but...
  156.  
  157.   o Making the command even closer to the COPY command.  It should include
  158.     at the least the NOREQ switch.  But I'm not sure how.  Maybe check the
  159.     device list with a doslist?  Send me help!
  160.  
  161.  
  162.     And of course, I know of at lease one bug that needs to be fixed:
  163.  
  164.   * If the command line includes spaces at the end, it conks out.  This will
  165.     be looked into.  I hope this doesn't piss anyone off...
  166.  
  167.  
  168.  
  169. Good luck, and I hope this spices up your ole workbench screen.
  170.  
  171.  
  172. Merry X-MAS!
  173.  
  174.