TABLE OF CONTENTS


::pwtk::outdir_postfix

SYNOPSIS

proc ::pwtk::outdir_postfix {{postfix {}}} {

PURPOSE

Set (or query) the outdir_postfix.

Note that the full "outdir" is: $outdir_prefix/$outdir_postfix. Beware that prior to calling this routine in set mode, the ::pwtk::outdir_prefix command should be called.

RETURN VALUE

SOURCE

    variable QEdir
    
    if { $postfix == "" } {
        return [varvalue QEdir(outdirPostfix)]
    }

    set QEdir(outdirPostfix) $postfix
    
    if { ! [info exists QEdir(outdirPrefix)] } {
        global env
        if { [info exists env(ESPRESSO_TMPDIR)] } {
            ::pwtk::warning "do not use outdir_postfix if outdir_prefix is not defined, setting outdir_prefix to env(ESPRESSO_TMPDIR), which is $env(ESPRESSO_TMPDIR)"
            set QEdir(outdirPrefix) $env(ESPRESSO_TMPDIR)
        }
    }
    
    if { [varvalue QEdir(outdirPrefix)] == {} } {
        ::pwtk::error "outdir_prefix should be called prior to outdir_postfix" 1
    }
    return [outdir [file join $QEdir(outdirPrefix) $postfix]]
}