Do you have a sample workspace you could upload for reference?
Hi @dustin Thanks for your reply. I haven't added a sample workspace, but this one can be fast to test since it's just the Creator + filecopy writer. I've just edited my question to add the screenshots. The 2020 example creates a folder, the 2023 example doesn't! Are you experiencing the same outcome?
Hi @dustin Thanks for your reply. I haven't added a sample workspace, but this one can be fast to test since it's just the Creator + filecopy writer. I've just edited my question to add the screenshots. The 2020 example creates a folder, the 2023 example doesn't! Are you experiencing the same outcome?
I haven't experienced that issue with the FileCopy writer, but I normally will use a PythonCaller or PythonCreator to accomplish that task. The code below will create a new directory (copy/paste into PythonCreator). You'll just need to update the new_dir parameter with the path you want.
import fmeobjects
import os
class FeatureCreator(object):
"""Template Class Interface:
When using this class, make sure its name is set as the value of the 'Class
to Process Features' transformer parameter.
"""
def __init__(self):
"""Base constructor for class members."""
pass
def input(self, feature):
"""This method is called once by FME to create FME Feature(s).
A created Feature is emitted through the self.pyoutput() method.
Any number of Features can be created and emitted by this method.
:param fmeobjects.FMEFeature feature: Dummy FME Feature passed in by
FME. It can be ignored.
"""
new_dir = "E:\your_path"
if not os.path.exists(new_dir):
os.mkdir(new_dir)
newFeature = fmeobjects.FMEFeature()
self.pyoutput(newFeature)
def close(self):
"""This method is called at the end of the class."""
pass