home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / xdel107b.zip / xdel.txt < prev   
Text File  |  2000-07-30  |  14KB  |  349 lines

  1.  
  2.         XDEL - an enhanced DEL command for OS/2 
  3.  
  4.             Copyright (c) 1995, 1996, 1997 Klaus Joosz
  5.               All rights reserved.
  6.  
  7.     This program is free software. It is distributed in the hope that it 
  8.     will be useful, but WITHOUT ANY WARRANTY.
  9.  
  10. -------------------------------------------------------------------------------
  11.  
  12. XDEL is an extension of the OS/2 DEL command. It will delete the specified 
  13. file(s) in a directory and all subdirectories contained within. This includes
  14. system, hidden and read only files. Files can be selected by timestamp, size
  15. or may contain a specified string. Extended attributes of files can be deleted
  16. without deleting the files themselves.
  17.  
  18. This is the XDEL help screen:
  19.  
  20. Usage: XDEL DELFILES INPUTFILES OPTIONS
  21.  
  22.             DELFILES:   [DRIVE:][PATH]FILENAME ...
  23.                         [DRIVE:]PATH ...
  24.  
  25.             INPUTFILES: @[DRIVE:][PATH]FILENAME ...
  26.  
  27. DELFILES are files or directories to be deleted.
  28. INPUTFILES are text files containing names of files and directories to be
  29. deleted, one name per line.
  30. DELFILES and files listed in INPUTFILES may contain wildcard characters such as
  31. '*' and '?'. Wildcards in directory names are not supported, any expression
  32. containing wildcards is regarded as a file name.
  33. At least one DELFILE or INPUTFILE must be specified.
  34.  
  35. Options are:
  36.   /A:SEARCHSTRING
  37.       Delete files containing the specified string (search is case sensitive)
  38.   /B:[OPERATOR]FILESIZE
  39.       Delete files whose size (in byte) is less than, less equal, greater than,
  40.       greater equal, equal or not equal to the specified size.
  41.       If OPERATOR is omitted, less than is assumed.
  42.   /D  Delete empty subdirectories
  43.   /EA[:EXTENDED ATTRIBUTE]
  44.       Delete the extended attribute specified after the colon but do not delete
  45.       the file itself. If EXTENDED ATTRIBUTE is omitted all EAs of a file are
  46.       deleted.
  47.   /F  Do not move deleted files into DELDIR directory if DELDIR environment
  48.       variable is set. This disables file recovery via OS/2 UNDELETE command.
  49.   /I  Ignore settings in environment variable XDEL-DEFAULT-OPTIONS
  50.   /L  Do not list deleted files
  51.   /N  Start deletion without warning
  52.   /O[:PATTERN]
  53.       Overwrite files before deletion. If PATTERN is specified the file
  54.       is overwritten as often as there are characters in PATTERN each time
  55.       using a different character out of PATTERN.
  56.   /O+[:PATTERN]
  57.       Rename, move and overwrite files before deletion. If PATTERN is specified
  58.       the file is overwritten as often as there are characters in PATTERN each
  59.       time using a different character out of PATTERN.
  60.   /O-[:BYTES]
  61.       Rename, move and partially overwrite files before deletion. BYTES specifies
  62.       the size of the portion that is overwritten. If BYTES is omitted 0 is assumed.
  63.   /P  Pause on each file
  64.   /Q  Pause on each directory
  65.   /R  Delete READ ONLY files
  66.   /S  Delete matching files in subdirectories
  67.   /T:[OPERATOR]YEAR[-MONTH[-DAY[-HOURS[-MINUTES]]]]
  68.       Delete files with last write access less than, less equal, greater than,
  69.       greater equal, equal or not equal to the specified date and time.
  70.       If OPERATOR is omitted, less than is assumed. Format of date and time is
  71.       yyyy-mm-dd-hh-mm.
  72.   /U:FILENAME
  73.       Exclude file(s) from deletion. FILENAME may contain wildcard characters.
  74.   /X  Do not delete files in READ ONLY directories
  75.   /Y  Deletion of empty subdirectories will also affect READ ONLY directories
  76.   /?  Display this help message
  77.  
  78. OPERATORs are:
  79.   LT  Less Than
  80.   LE  Less Equal
  81.   GT  Greater Than
  82.   GE  Greater Equal
  83.   EQ  EQual
  84.   NE  Not Equal
  85.  
  86. Options and operators are not case sensitive
  87.  
  88. The above options can be set by environment variable for permanent use:
  89.   SET XDEL-DEFAULT-OPTIONS=OPTION OPTION ...
  90. Example:
  91.   SET XDEL-DEFAULT-OPTIONS=/O /N /L
  92. Options set by environment variable need not to be specified in the command
  93. line.
  94.  
  95. XDEL can be stopped any time by pressing a key.
  96.  
  97.  
  98.  
  99.  
  100. Installation
  101.  
  102. Copy XDEL.EXE to a directory referenced by the PATH environment variable.
  103.  
  104.  
  105. XDEL was developed using emx-gcc 0.9c. The executable in this package
  106. was created by the OS/2 Linker LINK386. It is a stand alone version, emx.dll
  107. is not needed.
  108.  
  109. Please send bug reports, comments and suggestions to klaus.joosz@usa.net.
  110.  
  111.  
  112. History
  113. -------
  114.  
  115. Version 1.03
  116.   
  117.   Fixed a bug with Novell NetWare 3.12: while scanning for subdirectories, 
  118.   normal files were found also. 
  119.  
  120.  
  121.   Directories with the HIDDEN attribute are now found.
  122.  
  123.  
  124.   Empty subdirectories with the READ ONLY attribute set will only be removed 
  125.   when the /Y option is used. 
  126.   It seems that OS/2 does not care about the READ ONLY attribute on local 
  127.   drives, so whether or not this attribute is set an empty subdirectory can 
  128.   be deleted with the RD command. On Novell network drives the READ ONLY 
  129.   attribute is supported.
  130.   Directory attributes can be displayed and removed with the ATTRIB command.
  131.   For I haven't found a command line tool to set directory attributes I wrote 
  132.   one of my own. The tool is called ATTRDIR.EXE and should be included in this 
  133.   package.
  134.  
  135.  
  136. Version 1.04
  137.  
  138.   Added switch /X to prevent files in READ ONLY directories from being deleted.
  139.  
  140.  
  141.   Fixed a bug parsing the [DRIVE:][PATH]FILENAME expression in the command 
  142.   line.
  143.  
  144.  
  145.   Added switch /T to exclude files with last write access newer than a certain
  146.   point of time from deletion. The last write access can be displayed by the
  147.   DIR command.
  148.  
  149.  
  150. Version 1.05
  151.  
  152.   Overwriting files now is significantly faster.
  153.  
  154.  
  155.   Added new command line syntax: XDEL [DRIVE:]PATH [/OPTION] [/OPTION] ...
  156.   Now you can specify the name of a directory to delete all files in that
  157.   directory. Instead of
  158.     XDEL \TMP\*
  159.   you can type
  160.     XDEL \TMP
  161.   The empty subdirectory is not deleted automatically. To delete it add the /D
  162.   switch.
  163.  
  164.  
  165.   Extended switch /T. Now you can delete files with a timestamp less than,
  166.   less equal, greater than, greater equal, equal or not equal a certain date
  167.   and time. To do so use the operators LT, LE, GT, GE, EQ and NE as mentioned
  168.   in the usage section of this file.
  169.   You can also combine two /T switches like that:
  170.     XDEL *.BAK /T:GE1997-05-01 /T:LE1997-05-31
  171.   This example shows how to delete all BAK files in the current directory
  172.   with last write access in May 1997.
  173.   If no operator is specified along with the /T switch LT is assumed.
  174.  
  175.  
  176.   Added switch /B to select files by size. The size must be specified in
  177.   byte. This switch supports the operators LT, LE, GT, GE, EQ and NE.
  178.   Two /B switches can be combined like that:
  179.     XDEL *.BAK /B:GE1000 /B:LT10000
  180.   In this example all BAK files in the current directory with size from 1000
  181.   to 9999 byte are deleted.
  182.   If no operator is specified along with the /B switch LT is assumed.
  183.  
  184.  
  185.   Added switch /A to delete files containing a certain string. If two or 
  186.   more /A switches are given only files containing all specified strings are
  187.   deleted.
  188.   String search is case sensitive.
  189.   If the string contains blank characters use double quotes like that:
  190.     XDEL *.BAK /A:"This string contains blank characters"
  191.   You can specify up to 16 /A switches in the command line.
  192.  
  193.  
  194.   Added switch /EA to delete extended attributes of files.
  195.   For example, you can delete the .LONGNAME and the .VERSION attributes of
  196.   all BAK files by typing
  197.     XDEL *.BAK /EA:.LONGNAME /EA:.VERSION
  198.   Delete all extended attributes of all BAK files by typing
  199.     XDEL *.BAK /EA
  200.   If the /EA switch is given only extended attributes of files are deleted
  201.   not the files themselves. To delete extended attributes of read only
  202.   files add the /R switch to the command line. Extended attributes of 
  203.   directories are not deleted.
  204.   You can specify up to 16 /EA: switches in the command line.
  205.  
  206.  
  207.   Pressing any key during execution of XDEL brings up the dialog
  208.   "Terminate XDEL ([Y]es [N]o) [A]bort)". When overwriting large files
  209.   or searching for text in large files the dialog might not appear
  210.   immediately after the key stroke.
  211.  
  212.  
  213. Version 1.06
  214.  
  215.   Changed dialog "Terminate XDEL ([Y]es [N]o) [A]bort)" to 
  216.   "Abort XDEL ([Y]es [N]o)".
  217.  
  218.  
  219.   Fixed a bug when deleting all extended attributes of files via the /EA
  220.   switch. Version 1.05 deleted up to a maximum number of 32 EAs per file.
  221.   Now ALL extended attributes of a file are deleted.
  222.  
  223.  
  224.   Added switch /O+ to clear information stored in the name, location and
  225.   timestamp of a file. This is a extension of the /O switch.
  226.   Even if a file cannot be recovered you can guess its contents from its
  227.   name, its directory and its timestamp. The switch /O+ helps you to avoid
  228.   this.
  229.   On HPFS drives XDEL will move the file to the root directory of its drive,
  230.   rename it, reset its timestamps, overwrite its contents with null
  231.   characters and finally delete it.
  232.   For example, you issue the command
  233.     XDEL C:\SECRET_SERVICE\TOP_AGENTS\JAMES_BOND.TXT /O+
  234.   This will move the file JAMES_BOND.TXT from the directory TOP_AGENTS to
  235.   the root directory of drive C:, rename it to something like 15320001.tmp
  236.   and set its timestamps to 01-01-1980 00:00 before it is overwritten and
  237.   deleted.
  238.   After this procedure a file recovery tool such as File Phoenix or GammaTech
  239.   Undelete will not find a file named JAMES_BOND.TXT, neither in its original
  240.   directory nor in any other directory.
  241.   On FAT drives moving a file from one directory to another will not clear
  242.   the filename completely in its original directory. Its first character
  243.   will be replaced by a '?' to mark it deleted and a file recovery tool
  244.   would find the filename entry ?AMES_BOND.TXT (if a FAT drive could handle
  245.   long filenames). Therefore on FAT drives and on any other non HPFS drives
  246.   XDEL will rename a file in its original directory without moving it.
  247.  
  248.  
  249.   Added switch /U:FILENAME to prevent the file(s) matching FILENAME from
  250.   being deleted. FILENAME may contain wildcard characters but must not
  251.   contain any drive or path information. The following example clears the
  252.   cache directory of a famous navigator from all temporary files but keeps
  253.   the file FAT.DB:
  254.     XDEL \NETSCAPE\CACHE\*.* /U:FAT.DB
  255.   You may want to keep all the HTM files also:
  256.     XDEL \NETSCAPE\CACHE\*.* /U:FAT.DB /C:*.HTM
  257.   A maximum number of 16 /U switches can be handled by XDEL.
  258.  
  259.  
  260. Version 1.07
  261.  
  262.   When overwriting a large file XDEL now brings up the dialog 
  263.   "Abort XDEL ([Y]es [N]o)" immediately after a key is pressed. Earlier versions
  264.   finished the currently processed file before bringing up the dialog.
  265.   If you select "Yes" the file remains partially overwritten but undeleted in
  266.   its original directory.
  267.  
  268.  
  269.   When using switch /A:SEARCHSTRING to delete files containing a certain piece
  270.   of text pressing a key now brings up the dialog "Abort XDEL ([Y]es [N]o)"
  271.   immediately even if a large file is processed.
  272.  
  273.  
  274.   Enhanced file overwriting capabilities. The new syntax of the /O and /O+
  275.   switches allows to enter a pattern from which the characters for overwriting
  276.   a file are taken:
  277.     /O[:PATTERN]
  278.     /O+[:PATTERN]
  279.   The file is overwritten as often as there are characters in PATTERN each time
  280.   using a different character out of PATTERN.
  281.   Example:
  282.     XDEL SECRETS.TXT /O:2L8
  283.   This will overwrite the file SECRETS.TXT three times, first time using the
  284.   digit "2" second time using the character "L" and finally using the digit "8".
  285.  
  286.   Characters that cannot be found on the keyboard may be entered by typing
  287.   their decimal ASCII code. An ASCII code which is part of PATTERN consists of
  288.   a backslash and three digits. Valid ASCII codes reach from \000 to \255.
  289.   The pattern in the following example contains one character. The ASCII code
  290.   of the character is 1 which in many ASCII tables is represented by a smiling
  291.   face.
  292.     XDEL SECRETS.TXT /O:\001
  293.   Here is another example:
  294.     XDEL SECRETS.TXT /O+:\255ou812B4\000
  295.  
  296.  
  297.   The new switch /O-[:BYTES] behaves similar to the /O+ switch except that
  298.   instead of the whole file a portion of it is overwritten. BYTES specifies
  299.   the size of the portion. If BYTES is omitted 0 is assumed i.e. no part of
  300.   the file is overwritten.
  301.  
  302.  
  303.   Enhanced command line. While earlier versions of XDEL allowed exactly one
  304.   file or directory to be specified in the command line this version supports
  305.   multiple filenames and directories, limited only by the amount of characters
  306.   the command line can hold.
  307.   Example:
  308.     XDEL C:\*.TMP C:\*.OLD C:\*.BAK /S
  309.   This will delete all *.TMP, *.OLD and *.BAK files in the root directory of
  310.   drive C: and in all subdirectories.
  311.   
  312.  
  313.   XDEL now reads names of files and directories to be deleted from an input
  314.   file. The first character of the expression containing the input file name
  315.   must be a "@" to prevent it from being deleted like the other files passed
  316.   to XDEL in the command line.
  317.   Example:
  318.     XDEL @D:\Utils\DelFileList.Txt /s /r
  319.   The input file may contain several file names, one per line:
  320.  
  321.     *.TMP
  322.     *.OLD
  323.     ;this is a comment
  324.     *.BAK
  325.     C:\WIN95\WIN.COM
  326.  
  327.   Another example shows how to delete the input file AFTER it has been 
  328.   processed:
  329.     XDEL *.TMP *.OLD @GARBAGE.TXT GARBAGE.TXT /s
  330.   This won't work:
  331.     XDEL *.TXT @GARBAGE.TXT /s
  332.  
  333.  
  334. Version 1.07a
  335.  
  336.   Fixed a bug where XDEL did not recurse into subdirectories with only the
  337.   archive attribute set when the /S option was specified.
  338.  
  339.  
  340. Version 1.07b
  341.  
  342.   When deleting empty subdirectories XDEL did not check for key strokes. So it
  343.   was impossible for the user to abort XDEL as long as it was deleting just
  344.   subdirectories and no files. This bug was fixed.
  345.  
  346.  
  347.                             Klaus Joosz
  348.                             July 30, 2000
  349.