About the Undelete Function
The operating system has an undelete capability but its use has been limited. There are users that recommend its non-use, supposedly for degraded performance (and it has been broken a time or two with bugs). It is not enabled during an install of the operation system. Given that background and the fact that the OS user interface is less than ideal, it has become a forgotten function. Contrary to popular opinion, enabling this feature does not noticeably degrade performance, at least in the way that FS/2 handles deleted files.
Recent kernel versions have a functional undelete capability for HPFS and JFS.
When using FS/2 for file management, it is STRONGLY RECOMMENDED that the delete directory be enabled and used!
This feature can be used in conjunction with a Desktop trash can object.
Using the Undelete Function
FS/2 interfaces with the DELETE directory quite well. It displays the DELETE directory in a Files window, much like any directory, and shows the path/filename of the deleted file vice the numeric name. In addition, it detects a corrupted CONTROL.DEL file and has a function to correct the corruption in most cases.
To enable this undelete capability, edit the CONFIG.SYS file and remove the REM in front of the SET DELDIR= statement. Each local hard drive will be in the statement, followed by a number which represents the sizeof that directory. Edit the drive list, leaving in just those drives that are to be enabled and also set the maximum size of the directory to whatever is appropriate for the system (how much drive space to give up). By default, the number is 512 which is 512K. Set this size to 1024, 2048 or 4096 (1,2 or 4 MBytes) or more if disk space is not a concern. Greater than 8096K is not generally recommended for typical use.
Note: The DELETE directory may be named to any legal directory name the user desires in the config.sys file. There may be even different names for different drives. In the example below, the DELETE directory is named 'Deleted'.
SET DELDIR=C:\Deleted,4096;D:\Deleted,4096;E:\Deleted,8192;F:\Deleted,4096;...etc.
In OS/2, files are be deleted to a numeric file name in the DELETE directory or permanently deleted (forced deleted). FS/2 has no capability to undelete permanently deleted files. The Options setup allows for the default file delete to be of either type. The option is titled 'Default is forced file delete' and is located on the first Options page in the setup notebook. The file delete dialog, which is optionally used, has a check box option to change this state for any one delete instance. If using the DELETE directory, with the builtin undelete capability to easily view and undelete files from this directory, make sure that the 'Delete is forced file delete' option is not enabled ( unchecked).
Delete
Directory
Providing that a drive has the delete directory enabled, all files that are not forced (permanently) deleted may be found, viewed and undeleted, subject to the directory size limitation placed in config.sys and the size of files deleted. Each deleted file has a 277 byte record stored in the CONTROL.DEL file. Selecting Undelete on the Files menu or pressing the Undelete toolbar button will cause a switch the DELETE directory and show the contents. One difference is readily apparent; deleted files that are still recoverable have a path for that drive shown. The user may view (browse) a selected ASCII file in a normal browse manner (double click on the filename) prior to undeleting it. Use the window popup menu to then either permanently delete or undelete the selected file(s). Undeleted files are restored in their original directory.
Deleted
Files Menu
When the DELETE directory fills to the maximum set size, the oldest files are force deleted, making room for the most recent deleted file. If the most recent deleted file exceeds the maximum set size, it may still be undeleted but will be the only deleted file in the directory.
The real numeric files in the delete directory may be listed by reading the directory with the Ctrl+Alt keys down or use the menu option Show Real Files. Reset the directory to normal operation by either selecting a different directory or rescan again with the Ctrl+Alt keys down.
The delete directory may be deleted by FS/2 at any time if there seems to be a problem with it. Upon next file delete, the directory, and its CONTROL.DEL file, will be re-created.
How it Works
When a file is deleted with the DosForceDelete API, the file is deleted regardless of the enablement of the DELETE directory. But if it is deleted with the DosDelete API and the DELETE directory is enabled, that file is not really deleted but is renamed to a numeric name and a 277 byte entry is added to a CONTROL.DEL file in the DELETE directory. This entry contains the new numeric name and space for a 260 byte path/filename. If there is a fault in this design, it is that the CONTROL.DEL file is prone to corruption and performance does tend to degrade when a large DELETE directory is used (and a large number of deleted files) since it is a series of 277 byte entries for each deleted file.