How do these file operations work?

greatman05

Posts: 423   +0
Hello. This might be a weird question, but I was working in Windows 7, and I moved a directory on my hard disk from one location to another on the same disk. The transfer was almost instantaneous. My question is, how is this possible? I'm really trying to ask how the Copy and Move file operations work in Windows. I figure they're similar to the way DOS did it, but I want to be sure.
 
I'm fairly certain that file and folder locations are established by pointer tables and hexadecimal address assignments, rather than actual physical locations, provided that the files exist in the same drive location.

If this criterion is met, the "move" command simply adjusts the pointers, it doesn't move the file.

The only operation that would actually move a file in this environment, is the disc defragmenter.

"Copy" is a different issue than "move". In this case the OS has to recreate the files.
 
OK. Thanks for answering that question :D

So, with that criterion established, how are defragmenters actually able to move files around on the same hard drive?
 
My understanding is that a defragmenter actually performs a read/write operation on the disk to change which physical sectors on the hard drive the file contents are written to. Then updates the file system to reflect the new position of the file.
 
Back