Skip to main content

Hello,

 

Really dumb question: can do I use FME workbench to create a new folder, ideally with todays date?

Will the filecopy mover just create the folder if it doesn't exist?

 

Cheers

N

Yes, the File Copy Writer will create the destination folder if it doesn't exist.


An alternative would be to use a Fanout on the writer

So in this case the workspace will create a folder named after the current date (yyyymmdd format) in the /Volumes/support/FME Knowledge folder. For some reason I'm getting errors when I don't include a character after that date, hence the _


Yet another Alternative available for use is SystemCaller, if you prefer Command Lines, and on Windows you can call the relevant File and Folder commands and use the System date and time variables like %date% and %time.   To get an equivalent YYYYMMDD format you can use

set YYYYMMDD=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%
mkdir "C:\BaseFolder\SubFolder%YYYYMMDD%" 

However, there are more than enough Transformers in FME to create the required folder path format, so this is only for those that maybe have an existing BAT they want to copy from  to replicate system level commands inside an FME workspace


Thank you for all your suggestions - really helpful!


Reply