cr_delete_orphans (private)

 cr_delete_orphans files

Defined in packages/acs-content-repository/tcl/content-procs.tcl

Delete orphaned files in the content repository.

Parameters:
files (required)

Partial Call Graph (max 5 caller/called nodes):
%3 cr_cleanup_orphaned_files cr_cleanup_orphaned_files (private) cr_delete_orphans cr_delete_orphans cr_cleanup_orphaned_files->cr_delete_orphans cr_count_file_entries cr_count_file_entries (private) cr_delete_orphans->cr_count_file_entries cr_fs_path cr_fs_path (private) cr_delete_orphans->cr_fs_path

Testcases:
No testcase defined.
Source code:
    set dir [cr_fs_path]
    foreach name $files {

        if {![file exists $dir$name]} {
            # the file does not exist anymore, nothing to do
            continue
        }

        if {![regexp {^[0-9/]+$} $name]} {
            ns_log notice "orphan handling: ignore strange entry from deletion log <$dir$name>"
            continue
        }

        set count [cr_count_file_entries $name]
        if {$count == 0} {
            # the content entry does not exist anymore, therefore, the
            # file is an orphan and should be removed
            ns_log notice "delete orphaned file $dir$name"
            file delete -- $dir$name
        }
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: