| clear-basic-locks | Index Level | clear-index |
| Syntax |
clear-file {(}{data} file.reference{, file.reference}) {(option}
clear-file {(}dict file.reference) {(option} |
| Category | TCL |
| Type | Verb |
| Description |
clears the dictionary or data section of the specified file of all items and retains the primary file space area.
Clears data from the file specified by "file.reference". The file is only cleared, not deleted. The file retains its name, base, and modulo for both dictionary and data sections. To clear the dictionary section, "dict" must be specified before the "file.reference". If "dict" is specified, file-defining items ("d-pointers") are not cleared. If no "level" is specified, the default is "data". |
| Options |
c "Scrubs" each frame of the file's primary space, changing every byte in the frame to x'ff'.
l No logging. When this option is active, no log of the clear-file is placed in the file-of-files item. This can increase performance significantly on temporary files which are cleared frequently. |
| See Also | delete-file create-file files OPEN scrubber file control block CLEARFILE |
| Example |
clear-file data old.invoices
Removes all items from the data level of the "old.invoices". clear-file dict invoice.history Removes all items except "d-pointers" to data sections from the dictionary of the "invoice.history" file. clear-file data invoices,archive Clears the "archive" data section located in the dictionary of the "invoices" file. |
| Warnings |
This command does not require confirmation.
If the file is a pointer file (D-pointer's attribute 1 is a "dp"), then the secondary filespace is NOT returned to overflow until a full SAVE clears the dirty bits, and eliminates the deleted items. If the file is an ordinary data file, then the secondary filespace is returned to overflow immediately. |
| Compatibility | D3 7.0 AP R83 |
| clear-basic-locks | Index Level | clear-index |