file fragmentation project
kirk at strauser.com
Wed Jun 2 23:55:06 CEST 2004
-----BEGIN PGP SIGNED MESSAGE-----
At 2004-06-02T21:10:02Z, Bart Nessux <bart_nessux at hotmail.com> writes:
> In particular, I'd like to write a file fragmentor in Python that will
> randomly fragment x% of files on a NTFS filesystem into y number of
You may or may not be able to do so, depending on how smart your exact
version of NTFS decides to be on that given day. Still, the standard
algorithm to fragment a file m bytes long into n pieces is:
1) Create n * 2 files, each (m/n) bytes long.
2) Delete every other file.
3) Write the file to be fragmented, and hope that the filesystem naively
shoves it into the empty holes.
4) Delete the remaining "pad" files.
A similar algorithm is to replace step 1 with:
1) Fill the entire drive with files (m/n) bytes long.
If the filesystem isn't smart enough to rearrange empty blocks, then that
should to the trick.
> Anyway, would Python be acceptable for this type of project? Speed is
> somewhat important, but not extremely.
You bet. Filesystem speed will be the limiting factor.
The Strauser Group
Open. Solutions. Simple.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the Python-list