TABLE OF CONTENTS
::pwtk::headname
SYNOPSIS
proc ::pwtk::headname {filename {extensions {.in .inp}}} {
ARGUMENTS
- filename -- name of file
- extension -- list of cropping extensions (optional, default = {.in .inp})
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 }