Check if file copying is complete

I am writing an ASP.NET webapp that will copy the contents of a CD into a network share. I need to periodically check if the copy job is completed.

One way to do this is to check the network share folder to see if the file size has changed since the last check, but it seems perverted. Does anyone know better how to do this?

Thanks in advance, Stein

EDIT
a few more explanations:
Basically, I call the JsonResult action method every 5 seconds called getStatus (source, destination). This method should check the following:
- if the source directory is still empty, copying cannot be started → return the status "Pending"
- if the source directory contains files, the copy can be launched -_> call the copy method + return status "copy"
- if the destination directory contains files, and the file size remains the same, the copy is completed → the return status is "completed"

Thank!

+3
source share
2 answers

- , File.Copy, , . (, "3 9 " " !" " :..." ) ( , Session, ,...). Status.aspx, .

+2

-, javascript, : StartCopying, CheckStatus.

  • StartCopying backgorund thread , [SoapDocumentMethod (OneWay = true)], , .
  • CheckStatus , , .
0

Source: https://habr.com/ru/post/1732182/


All Articles