Is it possible to copy folder structure without copying files inside ? How do I set the writer ?
What is the filecopy_type parameter ? and what are it’s possible values ? The parameter exists on the writer but I can’t find any information.
Thank you
Page 1 / 1
Hi @tsirkuse ,
I don't think that there is any option to copy only folder structure with File Copy writer unfortunately.
However, Python scripting might help you. For example, this script defined in a PythonCaller creates the same folder structure as the subfolders of “_source_folder” under “_destination_folder”.
import fme import fmeobjects, os
class DirectoryCopier(object): def __init__(self): pass
def input(self, feature: fmeobjects.FMEFeature): def copy_dirs(src, dst): with os.scandir(src) as iter: for entry in iter: if os.path.isdir(entry.path): dir = os.path.join(dst, entry.name) os.makedirs(dir) copy_dirs(entry.path, dir)
You could use the Directory and File Pathnames reader to read only the folders, then write a blank text file to the lowest folders (to create all the higher folders in the tree), then go through a delete the blank text files.
In my view, the approach @takashi outlined would be what I’d choose unless overarching policies blocked the use of Python
You can also use SystemCaller, and invoke xcopy (of robocopy) there. With xcopy use something like