This topic contains 2 replies, has 2 voices, and was last updated by  Ryan McBee 4 years, 5 months ago.

Passing a variable to a file name

  • This is a weird scenario so bear with me:

    I usually have a file to file interface with a translator built into the filter to manipulate the format. But I’ve run accross a system that needs information from the file’s data saved into the filename. This scenario doesn’t seem to work so I’ve built a File to Translator interface that writes each file out individually. Because of some support / reporting I’ve build around my other method, I’d like to know if that was nessecary. Is there any way I can take a value from the file I’m processing in the filter’s translator and pass it out to Iguana so I can use it in the file’s name in the outbound part of the thread?

    Desire State

    • File to File Interface with a filter translator
    • Each file is a message that writes to a new file.
    • Each file contains a field telling the target system what the file is used for (I’ll call it Type)
    • Target system needs that Type to tell it how to file the message

    P.S. It’s worth calling out that I already have this working in a File->Translator scenario. I can get the result I’m looking for, I just want to know if there was an easier way.

    M.R. McBee

    In general I think this is best practice. The To/From File components date from before the the translator. I usually
    pick on them as an example of benefits of minimalism:

    http://wiki.interfaceware.com/210.html

    Using the io.open etc. file functions in Lua is quite easy and gives you so much more power than the built in To/From File components in Iguana.

    Thanks Eliot.

    M.R. McBee

You must be logged in to reply to this topic.