Search code examples
network-programmingserverrm

Does deleting a file on a webserver cancel its transmission?


I have a huge file on a server, e.g. a movie. Someone starts to down load that file. The download is not immediate, because the network has a certain maximum transmission rate. While the server is in the process of sending the file, I enter the command to delete the file.

What is the expected behavior?

  • Is the transmission cancelled?

  • Is the transmission completed first?

And if it is completed first, what if another request to download that file comes in before the delete command is carried out? Is that request queued behind the delete command or is it carried out parallel to other commands so that it is begun before the delete comes into effect, effectively keeping on blocking it.

On my desktop computer I cannot delete a file that is in use. Do web servers differ?


Solution

    • If the platform is Windows you can't delete the file.
    • if the platform is Unix- or Linux-based you can delete the file: however it remains in existence while it is open, which includes while it is being transmitted.
    • I'm not aware of any operating system where you are notified that a file you have open has been deleted, which is the only mechanism that could possibly cause transmission to be cancelled.