Skip to main content
Solved

Can we delete input file after zipping through ZipArchiver.


nag
Contributor
Forum|alt.badge.img
  • Contributor

Hello Team,

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

Thanks,

Nagendra

Best answer by itay

Hi @nshetty,

Or just good old DOS command with the SystemCaller?

 

View original
Did this help you find an answer to your question?

5 replies

debbiatsafe
Safer
Forum|alt.badge.img+20

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).


itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • Best Answer
  • July 18, 2019

Hi @nshetty,

Or just good old DOS command with the SystemCaller?

 


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • July 18, 2019
itay wrote:

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.


nag
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • July 19, 2019
itay wrote:

Hi @nshetty,

Or just good old DOS command with the SystemCaller?

 

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


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • July 19, 2019
nag wrote:

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.

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings