For example to use function ZipPack
char l_acBuf[]={"D:\Test\7z a -t7z "D:\Test\log.7z" "D:\Test\log\log1.txt" "D:\Test\log\log2.txt" "D:\Test\log\log3.txt""}
ZipPack(l_acBuf);
After GetExitCodeProcess is executed, dwErr is equal 1.Manual says error code with 1 means warning.
In fact file log.7z contains nothing. Also I find that these three files cannot open and information of pop message box is "The process cannot access the file because it is being used by another process".
7z version used is 16.2 and 16.4
Thanks in advance for any suggestion.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Something needs to clear that these three files to be compressed don't be used by other process. These files can't be open after 7z.exe is invoked by CreateProcess to compresses them.
If input parameter p_pcCmd in CreateProcess is typed completed in console window, these files are compressed successfully.
Where is the problem when compressed file with error code equal 1. In other words, what is the root for this situation.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Question description
Process flow such as follows
int ZipPack(char* p_pcCmd)
{
_PROCESS_INFORMATION l_sProInfo={0};
STARTUPINFO l_sStartupInfo={0};
}
For example to use function ZipPack
char l_acBuf[]={"D:\Test\7z a -t7z "D:\Test\log.7z" "D:\Test\log\log1.txt" "D:\Test\log\log2.txt" "D:\Test\log\log3.txt""}
ZipPack(l_acBuf);
After GetExitCodeProcess is executed, dwErr is equal 1.Manual says error code with 1 means warning.
In fact file log.7z contains nothing. Also I find that these three files cannot open and information of pop message box is "The process cannot access the file because it is being used by another process".
7z version used is 16.2 and 16.4
Thanks in advance for any suggestion.
try -ssw : compress shared files.
Thanks for response.
Something needs to clear that these three files to be compressed don't be used by other process. These files can't be open after 7z.exe is invoked by CreateProcess to compresses them.
If input parameter p_pcCmd in CreateProcess is typed completed in console window, these files are compressed successfully.
Where is the problem when compressed file with error code equal 1. In other words, what is the root for this situation.
Thanks for reply patiently.
I found the reason is due to my foolish operation don't close file when open file.
Very much thanks.