TABLE OF CONTENTS


::pwtk::headname

SYNOPSIS

proc ::pwtk::headname {filename {extensions {.in .inp}}} {

ARGUMENTS

PURPOSE

Return the filename croped by the suffix if the suffix matches one of the specified extensions. For example:

      ::pwtk::headname myInput.in {.inp .in}

would return myInput.

SOURCE

    set file_ext [file extension $filename]
    foreach ext $extensions {
        if { [string match -nocase $ext $file_ext] } {
            return [file rootname $filename]
        }
    }
    return $filename
}