TABLE OF CONTENTS


::pwtk::outdir_query

SYNOPSIS

proc ::pwtk::outdir_query {{hard {}}} {

USAGE

   outdir_query ?-hard?

PURPOSE

Query the outdir directory.

RETURN VALUE

The value of the current outdir.

If -hard option is specified and outdir is not defined, the routine returns the value of ESPRESSO_TMPDIR enviromental variable if it is defined or "." (i.e. current directory) otherwise.

SOURCE

    input_push
       ::pwtk::pwi::loadDefaults_ 
       set outdir [::pwtk::input::namelistGetVarValue CONTROL outdir 1]    
    input_pop

    if { $outdir == "" } {
        variable QEdir
        if { [info exists QEdir(ESPRESSO_TMPDIR)] && $QEdir(ESPRESSO_TMPDIR) != "" } {
            set outdir $QEdir(ESPRESSO_TMPDIR)
        }
    }

    # -hard option
    if { $hard != "" } {
        if { $hard != "-hard" } {
            ::pwtk::error "wrong option '$hard', must be -hard" 1
        } elseif { $outdir == {} } {
            global env
            if { [info exists env(ESPRESSO_TMPDIR)] } {
                set outdir $env(ESPRESSO_TMPDIR)
            } else {
                set outdir .
            }
        }
    }
    
    return $outdir
}