Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
My input to form is ZIP file.
Then I unzip it using ICSharpCode.SharpZipLib.dll and read some Test.txt file in it.

But after I Unzip it, I try to read Test.txt and the application throws the error "File is used by another process"

This means when unzip process is in progress the application is trying to read Test.txt file.

What should I do ?
How do I wait till file is successfully unzipped.

I tried with Thread.Sleep() but failed.

Any help to wait until process complete

- Thanks in advnace
Posted
Updated 6-May-11 22:14pm
v2
Comments
Dalek Dave 7-May-11 4:14am    
Edited for Grammar, Syntax and Readability.

1 solution

It is tough to answer without looking at the code. But try to make sure the process has completed and no references (to the zipped file) are held by the SharpZipLib.
 
Share this answer
 
Comments
koolprasad2003 7-May-11 3:16am    
It is solved, I used .Dispose for my all objects and it works
Thanks
Abhinav S 7-May-11 4:42am    
You are welcome.
Dalek Dave 7-May-11 4:14am    
Fair point.
Abhinav S 7-May-11 4:42am    
Thanks.
Prasanta_Prince 7-May-11 4:45am    
Good one.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900