XDEL - an enhanced DEL command for OS/2 Copyright (c) 1995, 1996, 1997 Klaus Joosz All rights reserved. This program is free software. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. ------------------------------------------------------------------------------- XDEL is an extension of the OS/2 DEL command. It will delete the specified file(s) in a directory and all subdirectories contained within. This includes system, hidden and read only files. Files can be selected by timestamp, size or may contain a specified string. Extended attributes of files can be deleted without deleting the files themselves. This is the XDEL options screen: Usage: XDEL [DRIVE:]PATH [/OPTION] [/OPTION] ... XDEL [DRIVE:][PATH]FILENAME [/OPTION] [/OPTION] ... FILENAME may contain wildcard characters such as '*' and '?'. Options are: /A:SEARCHSTRING Delete files containing the specified string (search is case sensitive) /B:[OPERATOR]FILESIZE Delete files whose size (in byte) is less than, less equal, greater than, greater equal, equal or not equal to the specified size. If OPERATOR is omitted, less than is assumed. /D Delete empty subdirectories /EA[:EXTENDED ATTRIBUTE] Delete the extended attribute specified after the colon but do not delete the file itself. If EXTENDED ATTRIBUTE is omitted all EAs of a file are deleted. /F Deleted files cannot be recovered using the UNDELETE command /I Ignore settings in environment variable XDEL-DEFAULT-OPTIONS /L Do not list deleted files /N Start deletion without warning /O Overwrite files before deletion /P Pause on each file /Q Pause on each directory /R Delete READ ONLY files /S Delete matching files in subdirectories /T:[OPERATOR]YEAR[-MONTH[-DAY[-HOURS[-MINUTES]]]] Delete files with last write access less than, less equal, greater than, greater equal, equal or not equal to the specified date and time. If OPERATOR is omitted, less than is assumed. Format of date and time is yyyy-mm-dd-hh-mm. /X Do not delete files in READ ONLY directories /Y Deletion of empty subdirectories will also affect READ ONLY directories /? Display this help message OPERATORs are: LT Less Than LE Less Equal GT Greater Than GE Greater Equal EQ EQual NE Not Equal The above options can be set by environment variable for permanent use: SET XDEL-DEFAULT-OPTIONS=[/OPTION] [/OPTION] ... Options set by environment variable need not to be specified in the command line. Installation Copy XDEL.EXE to a directory referenced by the PATH environment variable. XDEL was developed using emx-gcc 0.9c. The executable in this package was created by the OS/2 Linker LINK386. It is a stand alone version, emx.dll is not needed. Please report bugs to klaus.joosz@usa.net. History ------- Version 1.03 Fixed a bug with Novell NetWare 3.12: while scanning for subdirectories, normal files were found also. Directories with the HIDDEN attribute are now found. Empty subdirectories with the READ ONLY attribute set will only be removed when the /Y option is used. It seems that OS/2 does not care about the READ ONLY attribute on local drives, so whether or not this attribute is set an empty subdirectory can be deleted with the RD command. On Novell network drives the READ ONLY attribute is supported. Directory attributes can be displayed and removed with the ATTRIB command. For I haven't found a command line tool to set directory attributes I wrote one of my own. The tool is called ATTRDIR.EXE and should be included in this package. Version 1.04 Added switch /X to prevent files in READ ONLY directories from being deleted. Fixed a bug parsing the [DRIVE:][PATH]FILENAME expression in the command line. Added switch /T to exclude files with last write access newer than a certain point of time from deletion. The last write access can be displayed by the DIR command. Version 1.05 Overwriting files now is significantly faster. Added new command line syntax: XDEL [DRIVE:]PATH [/OPTION] [/OPTION] ... Now you can specify the name of a directory to delete all files in that directory. Instead of XDEL \TMP\* you can type XDEL \TMP The empty subdirectory is not deleted automatically. To delete it add the /D switch. Extended switch /T. Now you can delete files with a timestamp less than, less equal, greater than, greater equal, equal or not equal a certain date and time. To do so use the operators LT, LE, GT, GE, EQ and NE as mentioned in the usage section of this file. You can also combine two /T switches like that: XDEL *.BAK /T:GE1997-05-01 /T:LE1997-05-31 This example shows how to delete all BAK files in the current directory with last write access in May 1997. If no operator is specified along with the /T switch LT is assumed. Added switch /B to select files by size. The size must be specified in byte. This switch supports the operators LT, LE, GT, GE, EQ and NE. Two /B switches can be combined like that: XDEL *.BAK /B:GE1000 /B:LT10000 In this example all BAK files in the current directory with size from 1000 to 9999 byte are deleted. If no operator is specified along with the /B switch LT is assumed. Added switch /A to delete files containing a certain string. If two or more /A switches are given only files containing all specified strings are deleted. String search is case sensitive. If the string contains blank characters use double quotes like that: XDEL *.BAK /A:"This string contains blank characters" You can specify up to 16 /A switches in the command line. Added switch /EA to delete extended attributes of files. For example you can delete the .LONGNAME and the .VERSION attributes of all BAK files by typing XDEL *.BAK /EA:.LONGNAME /EA:.VERSION Delete all extended attributes of all BAK files by typing XDEL *.BAK /EA If the /EA switch is given only extended attributes of files are deleted not the files themselves. To delete extended attributes of read only files add the /R switch to the command line. Extended attributes of directories are not deleted. You can specify up to 16 /EA: switches in the command line. Pressing any key during execution of XDEL brings up the dialog "Terminate XDEL ([Y]es [N]o) [A]bort)". When overwriting large files or searching for text in large files the dialog might not appear immediately after the key stroke. Klaus Joosz August 17, 1997