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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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.
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
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
Use 7z.dll instead of 7za. You can have full control of the decompression process.
Opps, This is p7zip forum. Then I suggest using 7z.so
It's quit complicated but worthy.
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