Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That portable defragmenter probably could run into problems because writing a single block file can take more than one block on disk (the file system may need extra directory block(s)). Instead of deleting the files, setting them to zero length might work better.

”and then writes out a shell script that accomplishes that”

You better use a different device for that.

Firstly, you don’t know how long that script will be, and its length will affect what commands to use.

Secondly, if you just make it long enough up front, it may occupy space that, at the end of its run, must store other data.

Here’s another even more impractical idea: if all you know is that your disk does first fit, can you write a program that, after whatever amount of disk I/O, defragments a drive? I think you can (ignoring blocks used to store directory information)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: