Menu

Detecting when archive is finished

Help
2010-05-18
2013-05-28
  • Dag Lønhøiden

    Dag Lønhøiden - 2010-05-18

    Hello!

    I have searched this forum, without finding answer to my question.
    I have a program that use 7za.exe to add files to an archive. When done, this archive is sent via FTP to an FTP server. Our customers will use this to send test data to our development department when error occurs that wee need test data to
    reconstruct.

    My problem is that sometimes big data should be added to the archive. This takes some time, and the program is executing into the procedure for sending the archive to the FTP server. But, the archive is not done yet.

    Is there a possibility to check if the archive is done?
    That way I can halt my program from executing until the archive is ready for sending with FTP.

    I hope someone can tip me for solutions

    Best regards
    Dagl

     
  • Gabriel Magana-Gonzalez

    When you spawn your 7za process, wait for it to finish.  Usually when you spawn a process from a programming language, your program continues to run at the same time as the spawned process.  You need to wait for the spawned process to finish.

    what language are you programming in?  There is almost always a way to wait for spawned process to terminate in most languages.

     
  • Dag Lønhøiden

    Dag Lønhøiden - 2010-05-21

    Thank you for your answer.
    I program in COBOL. The only way I can think of for spawn the process in COBOL, is to make it run in a seperate thread. And then wait for the thread to finish. That is one approach, I did not think of that in the first place. Thanks for reminding me.

    Ideally, I did not want to bring threading to this, cause it tends to give some hazzel from time to time. Especially if the program or thread crash for some reason etc. But come to think of it, it seems as the best alternative (so far).

    I think this will be my solution.

    Regards Dagl

     
  • Dag Lønhøiden

    Dag Lønhøiden - 2010-05-21

    Actually, this did not work. The thread returns just after the command line is executed. It does not wait until the command is finished.

    So, my problem still is unsolved. Any other suggestions is welcome.

    I think I must check the size of the target file, and decide that when it is not growing any more the command is finished.

    Regards Dagl

     
  • David Guan

    David Guan - 2010-06-02

    Use 7z.dll instead of 7za. You can have full control of the decompression process.

     
  • David Guan

    David Guan - 2010-06-02

    Opps, This is p7zip forum. Then I suggest using 7z.so
    It's quit complicated but worthy.

     
  • Dag Lønhøiden

    Dag Lønhøiden - 2010-06-02

    Thank you for your answer. I need to send just one file. And I understand that only 7za.exe can be standalone?
    Anyway, I have found a workaround to the problem. There was a possibility in our Cobol program to halt the execution until the command was finished. I just had not found it…..

    Thanks again for the help.

    Regards Dagl

     

Log in to post a comment.