LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Require some knowledge on file copying across networks (https://www.linuxquestions.org/questions/linux-software-2/require-some-knowledge-on-file-copying-across-networks-729096/)

gjagadish 05-28-2009 09:37 AM

Require some knowledge on file copying across networks
 
Hi all,

I just need to know what happens behind the scenes in the following situation,

1. Kick off some file transfer from machine A to machine B via SSH
2. While the file is being transferred, i deleted the destination file in machine B.
3. But in machine A, it shows that the file is still being transferred.

I don't know where it is transferring the file. Can someone help me to understand what is happening here?

And what will happen if i move the destination file to some other directory while it is being transferred from machine A ?

-Jagadish

MS3FGX 05-28-2009 09:47 AM

Linux systems don't write data directly to the disk, it is first cached in RAM until the system has some free time to permanently store it. So what you are seeing is machine A sending the file into the RAM of machine B.

Once the system realizes the file is not there anymore, it should just "forget" about it and free the RAM up for something else.

chrism01 05-28-2009 08:16 PM

To go a little deeper, rm ( implemented using unlink() ) doesn't actually delete the file until all processes using it have completed. However, it will not be visible using the ls cmd.
If you use a large enough file, you should be able to see disk usage via df or du, iirc.


All times are GMT -5. The time now is 06:03 AM.