home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / disks / tools / viewndel / viewndel.doc < prev    next >
Text File  |  1977-12-31  |  4KB  |  81 lines

  1. Command  : ViewNDel
  2. Function : Run upto 2 commands over a file before asking wether to delete
  3.         or not.  Useful from DOpus type programs for 'Pruning'
  4.         directories of archives, pictures etc etc.
  5. Author   : James Sleeman
  6. Language : C
  7. Compiled : SAS/C 6.51
  8.  
  9. DESCRIPTION
  10.  
  11.     I had a large directory of archive which I had gathered up over a
  12. while for various BBS's and the like, but of course I had no-idea which
  13. ones were of importance to me anymore and which I was able to delete.  So
  14. since I had just got SAS/C 6.51 and was teaching myself 'C' I thought it
  15. would be a good idea to write a small program which took a filename as an
  16. argument and then showed the contents of the file (archive) before asking
  17. if you wanted to delete it.  Of course this could have been done from a
  18. script .. but I need the practise in 'C'.  After I had whipped up a small
  19. hack to do this (5 mins or so) and used it from DOPUS to prune my archives
  20. directory (by making a button that called this program with each filename
  21. that was selected in turn) I set to generalise the program and came up with
  22. 'ViewNDel'.  
  23.  
  24. USAGE
  25.  
  26. Usage is from CLI only, and it only accepts 5 arguments, The first one is
  27. either T or F, if it is T then the program will ask if you want to delete
  28. the file or not, if it is F (or anything else for that matter) it will not
  29. ask you if you want to delete the file and neither will it delete the file
  30. at all.  The second argument is the file (including path of course) to
  31. actually do the operations on.  The third and fourth arguments are 2
  32. commands to run on the file, both are optional, but if you only have one
  33. then you can't use the 5th argument (else the fifth argument will be used
  34. as the 4th .. just cause I am lazy and can't be bothered putting in
  35. argument specifiers, or using ReadArgs for that matter).  The Fifth
  36. argument is pretty trivial, it prints out the commands (incorporated with
  37. filename) that the program executes, there is nothing specific yuo have to
  38. put for this argument, the mere fact that it exists will be sufficient to
  39. turn the option on.  
  40.  
  41. EXAMPLES
  42.  
  43. --> ViewNDel T S:Startup-Sequence Type "Type >Speak:"
  44.  
  45. this will first Type the file S:Startup-Sequence, and then speak the
  46. startup-sequence (actually type to the speak: device, but you knew that
  47. already), and finnaly ask you if you want to delete the file (if you press
  48. Y or y then it will be deleted using C:Delete - this is specified in the
  49. source, if you want it to delete it using some other method just edit the
  50. source and re-compile, or email me and ask me to update the program to
  51. accept another parameter for the delete command and I will do so.
  52.  
  53. --> ViewNDel F S:Startup-Sequence Type "Type >Speak:" Debug
  54.  
  55. This will do thew same as above, except that it will not ask if you want to
  56. delete the file (and it won't delete it either), and before it executes the
  57. commands it will print them out for you to see.
  58.  
  59. IMPORTANT
  60.  
  61. The first 2 arguments MUST be specified, this is just because I am Lazy
  62. though and can't be bothered to add argument specifiers at 12:47am on a
  63. Friday night .. if you have some strange desire to have them added lemme
  64. know and I will do so for you.
  65.  
  66. WARRANTY
  67.  
  68. None, use at your own risk.  There should be nothing that can harm your
  69. system though as long as you supply the arguments as I have said.
  70.  
  71. DISTRIBUTION
  72.  
  73. Email-Ware, if you use it send me some EMAIL, since this is my first 'C'
  74. program for real I am releasing the surce to anyone that want's it to, just
  75. drop me a line and I'll email it too you.
  76.  
  77. CONTACT
  78.  
  79. j_slee00@tpnet.co.nz
  80. sleemanj@voyager.co.nz
  81.