What happens at the hard drive if you are writing/removing two things at once?

I’m often downloading one or more things and deleting crap at the same time. Is the hard drive constantly switching between the two tasks if the information is on the same platter?

Deleting a file usually just means changing some indexing information on the disk.

Yes, the drive is writing the “one or more things” that you’re dowloading, and changing some other indexing information.

I wouldn’t think that you would see any noticeable degradation in disk performance because of it.

a) Your OS and the drive itself maintain a write cache (also a read cache) which makes it possible to stash data in RAM and let it queue up to be written to the disk.

b) A well-behaved OS does some advance figuring to establish parameters such as available free space and occupied blocks, allocating them before actually writing to them, so the areas of the hard drive that are to be occupied by Download #1 are off-limites to the process that is copying FileCopy #3 to the same hard drive, and if you try to throw away SourceFile #7 while it is still being copied to Location #13 you’ll be informed that the file is in use even though the copying is a background task at that point.

It doesn’t matter which platter the the files are on, the heads are locked together so they all move as one. In addition, the hard drive controller can only process one read/write request at a time. (It is the OS’s job to manage the requests.)

Moving the heads, and then waiting for the right sector to spin under the head, is very time consuming compared to the speed in general of PCs. Doing only one task that accesses the disk at a time is therefore a pretty good idea. But it also depends on the OS. Some are just a lot, lot, better at handling this. (And you can easily imagine which OS is the worst.)

I notice it a lot when my browser cache is being cleared. All of a sudden thousands of files are being erased. (As noted, this is a tiny write per file, but it is a lot of such writes.) Trying to do anything heavy on the disk at the same time is agonizingly slow.

But in your case, you are talking about downloads. Even with a cable/DSL connection, the transfer speed is so slow that your disk is not being pushed at all.

So if I am in the process of downloading a file and then go to download another, does the disk only write the first file and then go on to the second or does it constantly switch between the two.

I remember a computer class at UMBC where we learned the hard drive would spend a couple nanoseconds writing, if there was something that had to be deleted it would delete for a few nanos, then write again, delete again, write, delete, so on and so fifth. It can only do 1 operation at a time, but it divides access time b/t reading, writing/deleting.

The drive and controller don’t do files as such; they deal with blocks of a fixed size. A typical file is big enough that it occupies many blocks. While downloading multiple files, the operating system breaks each into blocks as the data arrives, and passes them on to the controller whenever a new block is ready. So the drive does switch between files as they come in. Of course an app can keep a whole file in memory until it’s ready to save, and then dump the whole thing at once, but the OS still sends it to the controller a block at a time.

(And BTW, it isn’t nanoseconds but milliseconds for a disk operation, a lot slower.)

I’m a programmer, but I don’t think that hard drives have a seperate “erase” function. Heck, deletion of a file has nothing to do with the drive itself really, it has to do with the filesystem.

In the case of the FAT file system, its nothing more than a write to the FAT marking a file as deleted. I don’t know about NTFS or other filesystems.

Delete is just used for comprehension, the heads on the hard drive are just written over. In FAT12/16/32/NTFS, the filename has the first character removed i believe. Which is why the undelete command works by re-entering the first character (as long as the drive isn’t defragmented. But over-writing the actual file is changing the 1’s and 0’s of the originial with a new one–in which case undelete won’t work.