pa_assert_dir (private)

 pa_assert_dir [ -check_base_path ] dir_path

Defined in packages/photo-album/tcl/photo-album-procs.tcl

Ensures that dirname exists under the PhotoDir Directory If -check_base_path flag specified, proc also checks if base path exists and adds it if necessary Won't cause an error if the directory is already there. Better than the stardard mkdir because it will make all the directories leading up to dirname borrowed from 3.4 download code

Switches:
-check_base_path
(boolean) (optional)
Parameters:
dir_path

Partial Call Graph (max 5 caller/called nodes):
%3 acs_root_dir acs_root_dir (public) parameter::get parameter::get (public) pa_assert_dir pa_assert_dir pa_assert_dir->acs_root_dir pa_assert_dir->parameter::get

Testcases:
No testcase defined.
Source code:
  
    if { $check_base_path_p } {
    set dir_path "[acs_root_dir]/[parameter::get -parameter PhotoDir]/$dir_path"
    set needed_dir ""
    } else {
    set needed_dir "[acs_root_dir]/[parameter::get -parameter PhotoDir]"
    }
    
    set dir_list [split $dir_path /]
    
    foreach dir $dir_list {
    ns_log Debug "pa_assert_dir: Checking: $dir"
        if {$dir eq ""} {
            continue
        }
        append needed_dir "/$dir"
        if {![file exists $needed_dir]} {
        ns_log Debug "pa_assert_dir: file mkdir $dir"
            file mkdir $needed_dir
        }
    }
Generic XQL file:
packages/photo-album/tcl/photo-album-procs.xql

PostgreSQL XQL file:
packages/photo-album/tcl/photo-album-procs-postgresql.xql

Oracle XQL file:
packages/photo-album/tcl/photo-album-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: