Consultor Eletrônico



Kbase 21611: 4GL. How To Delete Multiple Files Using a Wildcard Character
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   8/8/2006
Status: Unverified

GOAL:

How to delete multiple files using a wildcard character

FIX:

The OS-DELETE statement executes an operating system file or directory
delete from within Progress.

It can be used to delete an entire directory and its contents, but it does not allow for selecting multiple files at one time for deletion.

This is due to the OS-DELETE statement not allowing wildcard characters.

The OS-DELETE statement calls the OS-DELETE function, which permits just one file at a time to be deleted.

The example code below uses the OS-COMMAND statement to delete the value of an expression containing a wildcard character.

This example will delete all text files from a directory named junk located on the C: drive.

DEF VAR cdir AS CHARACTER.
cdir = "c:\junk\*.txt".
OS-COMMAND SILENT DEL value(cdir).