Skip to main content
Question

How do I tell FME to send the full path as a string and NOT $(FME_MF_DIR)?

  • April 19, 2017
  • 1 reply
  • 35 views

paalped
Contributor
Forum|alt.badge.img+5

Hello,

I have this problem when trying to open a directory with a python parameter.

The line in my script causing the error:

f=open(os.path.join(FME_MacroValues['path_orders'],ftp.nlst()[0]),'w')

IOError: No such file or directory: '$(FME_MF_DIR)orders\\\\1234567.WI02290100.vg'

How do I tell FME to send the full path as a string and NOT $(FME_MF_DIR)?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

paalped
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • April 19, 2017
I Solved this by accessing the same dictionary FME_MacroValues['FME_MF_DIR']

 

 

path = FME_MacroValues['path_orders']

 

if re.search('\\$\\(',path):

 

_path = path.split('(')[1].split(')')[0]

 

_path_rest = path.split(')')[1]

 

path = os.path.join(FME_MacroValues[_path],_path_rest)