Solved

Can we delete input file after zipping through ZipArchiver.


Badge

Hello Team,

I have archived a .jxl using ZipArchiver, After zipping the required file can we delete input file from source location.

Thanks,

Nagendra

icon

Best answer by itay 18 July 2019, 11:36

View original

5 replies

Userlevel 2
Badge +17

Hi @nshetty

After the ZipArchiver transformer, you can try using the File Copy writer and setting the destination dataset attribute to null as suggested here or using a Python script suggested in this Q&A post (see david_r's comment).

Badge +16

Hi @nshetty,

Or just good old DOS command with the SystemCaller?

 

Badge +22

Hi @nshetty,

Or just good old DOS command with the SystemCaller?

 

I have a few of those in places :). With FME now being available on multiple OS, python is probably the better way to go for compatibility reasons.

Badge

Hi @nshetty,

Or just good old DOS command with the SystemCaller?

 

Dos command worked for me, But again in confusion with jdh comments.

Badge +22

Dos command worked for me, But again in confusion with jdh comments.

@nag the SystemCaller runs a command line, so something like del c:\\a.txt will work fine on FME installed on windows. However on linux the command is rm (for remove instead of del for delete) so the workspace won't run as expected. I haven't the foggiest idea what a mac command would look like.

 

 

The python OS module is a portable way to access system functionality.

 

os.remove, os.rmdir and shutil.rmtree will all delete the specified file/dir/tree regardless of which OS the workspace is run on.

 

 

If everyone in your company uses windows it's irrelevant, if you have a mix of OS environments, it's something to be aware of.

Reply