Why does copying a file to the same computer take so long?

167 viewsOtherTechnology

Can’t the file stay in the same “spot” in storage and be just linked to?

In: Technology

4 Answers

Anonymous 0 Comments

If a file is copied within the same disk then the head has to jump back and forth between reading and writing. Copy is faster between two separate disks. “Linking” is a distinct action. You can do that on Windows with an Explorer plugin called “Link Shell Extension” or command-line tools. But if you’re asking for a copy, that is what you get. You may want to modify the copy and then it can’t share data anymore.

Anonymous 0 Comments

If you just want the file accessible from two different paths you can do that. What do then do is create a Symbolic link. It is not a common thing to do in Windows but quite common in UNIX environments [https://en.wikipedia.org/wiki/Symbolic_link](https://en.wikipedia.org/wiki/Symbolic_link)

The difference from a copy is you have only one file so if you open it with one name and change it then the same changes is there if you open it with the other namer.

You could design a file system that use something similar when you copy a file and then just duplicate a block that changes. It would require a lot of work to implement. It would also have interesting effects like you can run out of space by just editing a file that remains the same size.

In practice just making a copy of a file is a lot simpler, the advantages of a complex system like that is not with the complexity is adds.

Anonymous 0 Comments

In Windows, you can create a shortcut that links to the file. Moving a file is a quick operation, but copying a file involves locating unused areas of drive space and duplicating data.

Anonymous 0 Comments

What you refer to is a ‘move’, which is instant. Copying means you explicitly want a second copy, so you need to duplicate everything.

A file system consists of two items, a directory (which acts like a table of contents like in a book) and the actual files (across the many pages of the book). the directory contains the pointers (or links, as you called them) to the files.

If you move a file, it stays at the same place on the storage device, but the pointer in the directory changes in the directory, while still pointing to the same location.

If you copy a file, your goal is to actually have a second file, probably to change that file while keeping the original at a safe location. So this time, you need to make a new file, AND make a second entry in the directory.

If you wouldn’t make the second copy, you would have two entries in the directory that point to the same file. Any changes to the ‘copy’ would immediately also affect the original, as physically, they are the same file.