home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Utilities / Programming / EnterAct 3.5 / Drag_on Modules / hAWK programs / $DeleteFiles < prev    next >
Encoding:
Text File  |  1992-12-13  |  602 b   |  26 lines  |  [TEXT/KEEN]

  1. # $DeleteFiles : erases/deletes/removes one or more files. Call it
  2. #    what you will, it's permanent so use with caution.
  3. # Input from "Select input file..." or "MFS selected files" - it's
  4. # only the file names and locations that matter.
  5. # stdout contains a brief summary afterwards.
  6.  
  7. BEGIN {
  8.     DeleteTheFiles();
  9.     print ARGC-1, "files were deleted, no problems."
  10.     }
  11.  
  12. function DeleteTheFiles(    i)
  13.     {
  14.     for (i = 1; i < ARGC; ++i)#note ARGV[0] is just "hAWK"
  15.         {
  16.         if (!remove(ARGV[i]))
  17.             {
  18.             print "Error, could not delete", ARGV[i]
  19.             exit
  20.             }
  21.         print ARGV[i]
  22.         print "\t\twas deleted."
  23.         print ""
  24.         }
  25.     }
  26.