mumpsintersystems-ensemble

How can I get the file extension


In MUMPS how can I get the file extension is there a class I can use? Class(%File).GetFilename that will return the Full Message name but i would just like the extension?

Set tNameIn=##class(%File).GetFilename(pRequest.OriginalFilename)


Solution

  • You can use $piece for this.

    write $piece(tNameIn, ".", *)
    

    Should return the latest piece delimited my symbol dot
    And filename without extension will be

    write $piece(tNameIn, ".", 1, *-1)