Consultor Eletrônico



Kbase P100708: Issuing prolib -delete in a script file to remove procedures grows the pl file
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   05/02/2005
Status: Unverified

SYMPTOM(s):

Prolib -delete of procedures causes the procedure library file to grow

Script calls the prolib command for each procedure to delete

The procedure library is larger in size after procedures have been removed from it

CAUSE:

This is the expected behavior when calling the prolib -delete command to remove each desired procedure. The procedure file does not shrink after a prolib -delete is issued because the space is not released in the file. The space will be reused when new files are added to the procedure library.


A directory listing is kept at the end of the procedure library file with a list of all the files in the pl file. Every time a change is made (-add, -delete), the list is regenerated and written to the end of the file. Should something happen during this process (a crash of the process or the machine, for instance), the library file would not be corrupted since the pointer to the directory list is updated at the very end of the process.
Since the script runs a -delete for each single file, the directory list is regenerate every single time the prolib command is ran and the file will only grows because the space is never released.

FIX:

To resolve the problem perform one of the following options:

1. Modify the script to have a single call to the prolib command with all the files to be deleted listed. Calling prolib once would cause little growth of the file (just enough to regenerate a new directory list).

For example: prolib <path to pl>/test.pl -delete city.r -delete customer.r -delete address.r

2. After the procedures have been deleted use the prolib -compress option. Compressing a pl file consumes resources, and is not done automatically. To compress a library, PROLIB creates a temporary file that requires an area of disk space equal to the size of the compressed library.