Skip to main content
Solved

Can we delete input file after zipping through ZipArchiver.

  • July 16, 2019
  • 5 replies
  • 32 views

nag
Contributor
Forum|alt.badge.img
  • Contributor
  • 41 replies

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?

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

debbiatsafe
Safer
Forum|alt.badge.img+21
  • Safer
  • 648 replies
  • July 17, 2019

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+18
  • Supporter
  • 1442 replies
  • Best Answer
  • July 18, 2019

Hi @nshetty,

Or just good old DOS command with the SystemCaller?

 


jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • July 18, 2019

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
  • 41 replies
  • July 19, 2019

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+37
  • Contributor
  • 2002 replies
  • July 19, 2019

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.