Click here to Skip to main content
15,901,426 members
Please Sign up or sign in to vote.
1.00/5 (5 votes)
See more:
how do i calculate the time remaining and current file progress in file.copy();

File.Copy(sourceFile, destFile, true);

please help me
Richard Deeming 14-Dec-15 12:31pm    
You don't. When the method returns, the copy has completed. The time remaining is 0, and the progress is 100%.

Behind the scenes, it uses the native CopyFile[^] function, which doesn't provide any way to see the progress of the copy operation.
Palash Sachan 14-Dec-15 12:41pm    
then how can i get the progress??
Is there any other way to copy files in c#??
Richard MacCutchan 14-Dec-15 12:55pm    
Yes, you can read and write fixed blocks to copy the file, thus allowing you to calculate progress.
Palash Sachan 14-Dec-15 13:06pm    
can u pls give me some example..
Richard MacCutchan 14-Dec-15 13:10pm    
Sorry I don't have one; try studying the documentation for reading and writing files, and developing your own sample.

I just looked at your previous question on the same subject (update progress percentage in c# console[^]), where this was already explained to you. Please do not repost the same question, you are just wasting our time and your own.
Share this answer
You cannot show any progress just because there are no any hooks into File.Copy. If you need to report progress of file copy (but I doubt that), you need your own version of file copy.

I also answered your question before: update progress percentage in c# console[^].

I don't understand how would you fail to understand it. You could ask some follow-up questions if you needed clarification. I'll gladly answer.

Share this answer

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