Question
· Apr 2

How to define file name in EnsLib.File.PassthroughOperation?

EnsLib.File.PassthroughOperation has File Name property with default value: %f_%Q%!+(_a)

The Management Portal documentation description of the property:

Name of file to output the document(s) to. May include timestamp specifiers. The %f specifier if present will be replaced with the name of the document's original source filename (stripped of characters illegal in target filenames).

See the method Ens.Util.File.CreateTimestamp() for documentation of timestamping options.

More documentation describing the behaviour of %f: https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...

But I fail to find any documentation how I can set the "document's original source filename". The data is written correctly to a file but the file names are like:

$ ls -1 /tmp/out/
_2024-04-02_17.10.16.766
_2024-04-02_17.12.14.145
_2024-04-02_17.24.06.437
Product version: IRIS 2022.1
$ZV: IRIS for UNIX (Ubuntu Server LTS for x86-64 Containers) 2022.1.2 (Build 574_0_22161U) Tue Jan 24 2023 11:05:57 EST
Discussion (5)2
Log in or sign up to continue

Yes that works, but I don't think the documentation agrees. https://docs.intersystems.com/irislatest/csp/documatic/%25CSP.Documatic.... says:

The %f specifier if present will be replaced with the name of the document's original source filename (stripped of certain characters in target filenames - see CharacterSetToRemove)

If I can't set "the name of the document's original source filename" then IMO the documentation is wrong.

Argh. Ens.StreamContainer#StreamSet silently overwrites OriginalFilename property.

Filename (%f) is empty:

// in is a character stream

#dim exportRequest = ##class(Ens.StreamContainer).%New()
set exportRequest.OriginalFilename = "foo"
set status = exportRequest.StreamSet(in)


Filename (%f) is "foo":

// in is a character stream

#dim exportRequest = ##class(Ens.StreamContainer).%New()
set status = exportRequest.StreamSet(in)
set exportRequest.OriginalFilename = "foo"