Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am creating a python script which will move the fresh zipped files to a hotfolder. But when i am creating a zip file with zip test.zip /opt/test it creates a temp file first, something like xAbCG77, then it renames it to test.zip, is there any way to create the zip files with the original name, or is there a way to track what is going to be the name of that file, is it a hash for the name?

Thanks.

share|improve this question
    
But if it creates the zip file, and then renames it, you can't just wait until it renames and then move the final (correct name) file ? – woliveirajr Oct 8 '13 at 14:03
    
i am running a scan in every five minutes, and i have some really heavy zip files which are getting created by other users on network. – abhishekgarg Oct 8 '13 at 14:10
1  
@woliveirajr I think he is creating it directly in the hotfolder. The zip I use creates a temp-file in the current directory so you could try to execute the zip command in a different directory then the holtfolder and doing zip /hotfolder/test.zip /opt/test. You could also created somewhere else and move it. – Rik Oct 8 '13 at 14:10
1  
zip -/opt/test > test.zip works.. thanks a lot – abhishekgarg Oct 8 '13 at 14:15
up vote 1 down vote accepted

It depends on your zip version. My zip creates the temp-file in the current directory.

You could try something like zip - /opt/test > test.zip but it depends on your zip-version if this works.

I would just do a cd /tmp and then execute zip /hotfolder/test.zip /opt/test. This way your temp-file is created in your /tmp and moved directly after successful creation.

share|improve this answer
    
thanks for the help – abhishekgarg Oct 8 '13 at 14:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .