home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 153.img / TELES.ZIP / RAP.PAS < prev    next >
Pascal/Delphi Source File  |  1988-04-03  |  28KB  |  266 lines

  1. {****************************************************************************}
  2. {                                                                            }
  3. {    ZAP - Directory and file "zapper" to allow easy disk cleaning.          }
  4. {                                                                            }
  5. {    Usage:  ZAP [d:][pathname]                                              }
  6. {                                                                            }
  7. {            where [d:] may specify an optional disk drive other than the    }
  8. {            current default drive and [pathname] specifies the unique       }
  9. {            pathname for starting the purge operation.  ZAP will scan all   }
  10. {            directories beginning with "pathname" and any children that     }
  11. {            it contains.  After printing out a status report of the         }
  12. {            number of files and directories located, ZAP will first         }
  13. {            remove all files regardless of their current protection         }
  14. {            status or hidden/system status and then will remove the         }
  15. {            directories including the beginning "pathname".                 }
  16. {                                                                            }
  17. {            ZAP performs a number of checks to validate the beginning       }
  18. {            directory and will not let you specify the Root directory or    }
  19. {            the current directory as beginning points for the purge.        }
  20. {            ZAP, however, cannot easily detect when you are in a            }
  21. {            directory located within the path to be purged.  In this        }
  22. {            case, ZAP will abort with a Run-Time error as it attempts to    }
  23. {            change to a directory that it just deleted.                     }
  24. {                                                                            }
  25. {            ZAP was written for Turbo Pascal Version 3.x but I realize      }
  26. {            that several of you will have purchased Version 4.0 so I have   }
  27. {            indicated the required changes in ZAP to allow proper           }
  28. {            compilation under that version.  Remove the comment braces      }
  29. {            from the TP 4.0 statements and either comment out the TP 3.x    }
  30. {            statements or delete them.                                      }
  31. {                                                                            }
  32. {            Note that the standard Turbo Pascal Version 3 procedures        }
  33. {            'NormVideo' and 'LowVideo' behave differently in Version 4.0.   }
  34. {            Also, the value of 'IOResult' is different.  You may ignore     }
  35. {            any warning messages regarding these if you convert this        }
  36. {            program to TP 4.0                                               }
  37. {                                                                            }
  38. {            Written by:                                                     }
  39. {                          LCDR John B. Harrell, III                         }
  40. {                          1519-A Carswell Circle                            }
  41. {                          Bolling Air Force Base                            }
  42. {                          Washington, DC 20336                              }
  43. {                                                                            }
  44. {****************************************************************************}
  45.  
  46. {$R-}    {Range checking off}
  47. {$B+}    {Boolean complete evaluation on}
  48. {$S+}    {Stack checking on}
  49. {$I+}    {I/O checking on}
  50. {$N-}    {No numeric coprocessor}
  51.  
  52. PROGRAM DirectoryZapper;
  53.  
  54.  USES
  55.    Crt,
  56.    D)b  }
  57. w proh                                             }
  58. {****************{****eproteetion eon )     1519-A Carswell Circle      ID)nersion 4.0. ap        <rKrsÇ****************************************************************}
  59. {                                                                            }
  60. {    ZAP - Directory and file "zapper" to allow easy disk cleaning.          }
  61. {                                                                            }
  62. {    Usage:  ZAP [d:][pathname]                                              }
  63. {                                                                            }
  64. {            where [d:] may specify an optional disk drive other than the    }
  65. {            current default drive and [pathname] specifies the unique       }
  66. {            pathname for starting the purge operation.  ZAP will scan all   }
  67. {            directories beginning with "pathname" and any children that     }
  68. {            it contains.  After printing out a status report of the         }
  69. {            number of files and directories located, ZAP will first         }
  70. {            remove all files regardless of their current protection         }
  71. {            status or hidden/system status and then will remove the         }
  72. {            directories including the beginning "pathname".                 }
  73. {                                                         b   n       
  74. {b7prote 2033           }
  75. {            ZAP performs a number of checks to val         directory and will not let you specify the Root directory or    }
  76. {            the current directory as beginning pointsg points for the purge.        }
  77. {       AP, however, cannot easily detect when you are in a            }
  78. {            directory located within the path to be purged.  Inhis        }
  79. {            case, ZAP will abort with a Run-Time error as it attempts to    }
  80. {            change to a directory that it just deleted.                     }
  81. {                                                                            }
  82. {            ZAP was written for Turbo Pascal Version 3.x but I realize      }
  83. {            that several of you will have purchased Version 4.0 so I have   }
  84. {            indicated the required changes in ZAP to allow proper           }
  85. {            compilation under that version.  Remove the comment braces      }
  86. {            from the TP 4.0 statements and either comment out the TP 3.x    }
  87. {            statements or delete them.                                      }
  88. {                                                                            }
  89. {            Note that the standard Turbo Pascal Version 3 procedures        }
  90. {            'NormVideo' and 'LowVideo' behave differently in Version 4.0.   }
  91. {            Also, the value of 'IOResult' is different.  You may ignore     }
  92. {            any warning messages regarding these if you convert this        }
  93. {            program to TP 4.0                                               }
  94. {                                                                            }
  95. {            Written by:                                                     }
  96. {                          LCDR John B. Harrell, III                         }
  97. {                          1519-A Carswell Circle                            }
  98. {                          Bolling Air Force Base                            }
  99. {                          Washington, DC 20336                              }
  100. {                                                                            }
  101. {****************************************************************************}
  102.  
  103. {$R-}    {Range checking off}
  104. {$B+}    {Boolean complete evaluation on}
  105. {$S+}    {Stack checking on}
  106. {$I+}    {I/O checking on}
  107. {$N-}    {No numeric coprocessor}
  108.  
  109. PROGRAM DirectoryZapper;
  110.  
  111.  USES
  112.    Crt,
  113.    D)b  }
  114. w proh                                             }
  115. {****************{****eproteetion eon )     1519-A Carswell Circle      ID)nersion 4.0. ap        <rKrsÇ****************************************************************}
  116. {                                                                            }
  117. {    ZAP - Directory and file "zapper" to allow easy disk cleaning.          }
  118. {                                                                            }
  119. {    Usage:  ZAP [d:][pathname]                                              }
  120. {                                                                            }
  121. {            where [d:] may specify an optional disk drive other than the    }
  122. {            current default drive and [pathname] specifies the unique       }
  123. {            pathname for starting the purge operation.  ZAP will scan all   }
  124. {            directories beginning with "pathname" and any children that     }
  125. {            it contains.  After printing out a status report of the         }
  126. {            number of files and directories located, ZAP will first         }
  127. {            remove all files regardless of their current protection         }
  128. {            status or hidden/system status and then will remove the         }
  129. {            directories including the beginning "pathname".                 }
  130. {                                                         b   n       
  131. {b7prote 2033           }
  132. {            ZAP performs a number of checks to val         directory and will not let you specify the Root directory or    }
  133. {            the current directory as beginning pointsg points for the purge.        }
  134. {       AP, however, cannot easily detect when you are in a            }
  135. {            directory located within the path to be purged.  Inhis        }
  136. {            case, ZAP will abort with a Run-Time error as it attempts to    }
  137. {            change to a directory that it just deleted.                     }
  138. {                                                                            }
  139. {            ZAP was written for Turbo Pascal Version 3.x but I realize      }
  140. {            that several of you will have purchased Version 4.0 so I have   }
  141. {            indicated the required changes in ZAP to allow proper           }
  142. {            compilation under that version.  Remove the comment braces      }
  143. {            from the TP 4.0 statements and either comment out the TP 3.x    }
  144. {            statements or delete them.                                      }
  145. {                                                                            }
  146. {            Note that the standard Turbo Pascal Version 3 procedures        }
  147. {            'NormVideo' and 'LowVideo' behave differently in Version 4.0.   }
  148. {            Also, the value of 'IOResult' is different.  You may ignore     }
  149. {            any warning messages regarding these if you convert this        }
  150. {            program to TP 4.0                                               }
  151. {                                                                            }
  152. {            Written by:                                                     }
  153. {                          LCDR John B. Harrell, III                         }
  154. {                          1519-A Carswell Circle                            }
  155. {                          Bolling Air Force Base                            }
  156. {                          Washington, DC 20336                              }
  157. {                                                                            }
  158. {****************************************************************************}
  159.  
  160. {$R-}    {Range checking off}
  161. {$B+}    {Boolean complete evaluation on}
  162. {$S+}    {Stack checking on}
  163. {$I+}    {I/O checking on}
  164. {$N-}    {No numeric coprocessor}
  165.  
  166. PROGRAM DirectoryZapper;
  167.  
  168.  USES
  169.    Crt,
  170.    D)b  }
  171.    Bollingr llinTm &         numbw        
  172.  
  173. T       comment bram Force Base          A   ? ? ? ?.? ?'          Written by:                                                     }
  174. {                          LCDR John B. Harrell, III                         }
  175. {                                   Variwell of the         }
  176. {            numbe                          Bolling Air Force Base                            }
  177. {                          Washington, DC 20336                              }
  178. {         VAR     {    ***************** ***********         {   *****************C*************     apper;
  179. {   **checking on}
  180. {$N-} {No nume*}
  181.  
  182. {$R-}    reg    }
  183. {      : regardinglize  erform/BI   s and eit val  }         purged      :  be purgelize  Wtory or   the Root orkay an optiCoun 4.0. a             ****Cun 4****}
  184.  
  185. {$y an oCoun 4.0. a             ****Cun 4***y an o      Fund0. a      ****Flag     o)            und0. a      ****.0. a...
  186. {a }
  187. {        /syed und0.       ****.0. a. a...w  B }nthname for starting the purge operation.  ZAP will scan all   }
  188. {            directories beginning with "pathname" and any children that     }
  189. {            it contains.  AfterP         will nunc     df the     umbc            }
  190. {                          Bolling Air Force Base                            }
  191. {                          Washington, DC 20336                              }
  192. {           CEDURErK(VAR Bu      BEGIN               }
  193. {    {rKWITH reg  DO BEGIN
  194.  
  195. A   = 
  196.  
  197. DS  =g(Bu      DX  =Ofs(Bu      hem. (reg                         }
  198. {    {rKme for starting the purge operation.  ZAP will scan all   }
  199. {            directories beginning with "pathname" and any children that     }
  200. {            it contains. e)b  lliCecks t-Bak -} *****ng.dl{Nnt-} n
  201. {         wcontains. arKill mo   orb  llikeybo or looa Ctrt-Bak (Ctrt-C)it contains. keyCiroke{N-} ***** lli           the current directory as be                      Bolling Air Force Base                            }
  202. {                          Washington, DC 20336                              }
  203. {           CEDUREBak*********     BEGIN               }
  204. {    {Bak*********Chpti(       Halt(1)                 }
  205. {    {Bak*********      CEDURECBakKeyPrKedVAR    C   n 4.0    BEGIN               }
  206. {    {BakKeyPrKedWITH reg  DO BEGIN
  207.  
  208. A   =          }
  209. {    {Non-herircledriv    4***keybo or bu l sta(   , reg   }
  210. {    {Ree     key  BALill AH=0m
  211. {keyC l F     A 3) AND   H <> 0) THEN BEGIN
  212.  
  213.  ZAP [(Kbd     }
  214. {    
  215. {$hecks tokeyfrom bu lC  =ZAP [Key 
  216.  
  217. TBak*********                          }
  218. {    {BakKeyPrKed      CEDUREBak*********     BEGIN               }
  219. {    {Bak*********WITH reg  DO BEGIN
  220.  
  221. A   =****** }
  222. {    {erformsrequ   4{Ne)N-} *****v***********AL  =$2easy disk
  223. {    {Cecks t-Bak excep     ng.dlb lDS  =Cgasy disk
  224. {   ** S:DX muumeN-} 4{N lli arK lDS  =g(Bak*********      DX  =Ofs(Bak*********   ***** lliexcep     ng.dl lhem. (reg                         }
  225. {    {Bak*********   for starting the purge operation.  ZAP will scan all   }
  226. {            directories beginning with "pathname" and any children that     }
  227. {            it contains. ParsCommg.dL       rp   iell -} pre) llicommg.dingnhat the standar**e     g.divaliP w) lli*********   A**e    muumeren 4.0ntains. all muumereren 4aivaliP************ Bollid*-}diat the standard   T*****maymeolliRoomeric      1519-maymeollit the standar{$S+}ab  llicurren 4d*ric           }
  228. {            'NormVideo' and 'LowVideo' behave differently in Version 4.0.   }
  229. {            Also, the value of 'IOResult' is different.  You may ignore     }
  230. {            any warning messages FUNCTION ParsCommg.dL    *************VAR    Temp  *************       p1 *************      CEDUREAbort(Error       :remove      BEGIN               }
  231. {  {Abort lNmVideo     Write('PER: '      Write(Error            WriteLn('!'      WriteLn('Usage:. PER [d:][********]'      WriteLn('  }
  232. {  "********"    aivaliP*ric      1*********'      WriteLn('  }
  233. {             o llectory and.'      WriteLn('  }
  234. {  "d:"ereren   g. op    
  235. {drdrivherign     .'      Chpti(       Halt(1)                 }
  236. {  {Abort    BEGIN               }
  237. {    {ParsCommg.dL     F  P*Cun 4= 0) OR  P*Cun 4> 1) THEN****Abort('P*e    error'      Temp  =P*   (1){$I-}             }
  238. {    {well auto thic I/O error c)     Chpti(Temp){$I+}             }
  239. {    {Enwell auto thic I/O error c)      F  IO   *<> 0) THEN****Abort('InvaliP***********<'+Temp+'>'      Gr(      p1      p1:='A:\'     ParsCommg.dL    *=    p1                 }
  240. {    {ParsCommg.dL       for starting the purge operation.  ZAP will scan all   }
  241. {            directories beginning with "pathname" and any children that     }
  242. {            it contains. Remov*}
  243.  
  244. {$R-   rp  d) {N lli****P*****   If g. error i    }
  245. {standardeed   ) llind or erforms}
  246. ls, g. error mrKage i    }
  247. {the standardplayed * BolliCRT           the current directory as beirectory as be                      Bolling Air Force Base                            }
  248. {                          Washington, DC 20336                              }
  249. {           CEDURERemovr(VAR r************      BEGIN               }
  250. {    {Removr)     LowVideo     Write('Remov)*}
  251.  
  252. {$R-<'      NmVideo     Write(r      LowVideo     WriteLn('>'      r[Length(r +1]  =Chr(       WITH reg  DO BEGIN
  253.  
  254. A   =Rmr 
  255.  
  256. DS  =g(r  {    {PN-} 4 S:DX  {N lli**** lliASCIIZ lDX  =Ofs(r +1lize  s      **P*from  llind or TP s       lhem. (reg        F Odd(     ) THEN****WriteLn('Error '          mov)<'  r   >'                        }
  257. {    {Removr)      for starting the purge operation.  ZAP will scan all   }
  258. {            directories beginning with "pathname" and any children that     }
  259. {            it contains. Usnd or erforms accrK {Nre** lli's{a }
  260. {      {Nit contains. ollids}
  261. divalue   Te nunc     ree     a zeroivalue if error i    }standardeed 519-ree      lli*on-zeroi    en   *** lliAX s and eitif g.y   }standarerror i  deed           the current directory as beirectory as be and 'LowVideo' behave differently in Version 4.0.   }
  262. {            Also, the value of 'IOResult' is different.  You may ignore     }
  263. {            any warning messages FUNCTION n 4ngeA }(VAR  **************NewA }   yte)              BEGIN               }
  264. {    {n 4ngeA } [Length( +1]  =Chr(       WITH reg  DO BEGIN
  265.  
  266. A   =ChMod     AL  =