The Prune method removes catalog entries whose corresponding files are no longer present on disk.

Example


; Start the application
e = ENVI()
 
; Get a raster file
file = FILEPATH('natural_earth_shaded_relief.jp2', ROOT_DIR=e.ROOT_DIR, $
  SUBDIRECTORY = ['data'])
 
; Make a copy in a temporary folder
tempFile = envi.GetTemporaryFilename('.tif')
File_Copy, file, tempFile
 
; Instantiate a new temporary catalog
catalog = ENVICatalog()
 
; This will print 0
print, catalog.n_entries
 
; Add the raster to the catalog
catalog.AddRaster, tempFile
 
; This will print 1
print, catalog.n_entries
 
; Delete the file
File_Delete, tempFile
 
; Prune the catalog
catalog.Prune, DELETED_ENTRIES=deleted_entries
 
; This will print 0
print, catalog.n_entries
 
; This will print the files we just deleted
print, deleted_entries

Syntax


ENVICatalog.Prune([, Keywords=value])

Arguments


None

Keywords


DELETED_ENTRIES

Set this keyword to a variable that will contain the array of files that have been pruned.

ERROR

Set this keyword to a named variable that will contain any error message issued during execution of this routine. If no error occurs, the ERROR variable will be set to a null string (''). If an error occurs and the routine is a function, then the function result will be undefined.

When this keyword is not set and an error occurs, ENVI returns to the caller and execution halts. In this case, the error message is contained within !ERROR_STATE and can be caught using IDL's CATCH routine. See IDL Help for more information on !ERROR_STATE and CATCH.

See Manage Errors for more information on error handling in ENVI programming.

Version History


ENVI 6.3

Introduced

See Also


ENVICatalog