Python may not be suitable for this, but I thought I'd ask the experts:
I'm doing a summer project that will attempt to measure exactly how file
fragmentation affects disk drive and OS performance. I'd like to use
Python for some of this. 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 fragments. For example, assuming that we
start with a 100% defragmented drive, run the program to randomly
fragment 20% of the drive's files into 7 different fragments (may also
base the number of fragments on the file's size).
Anyway, would Python be acceptable for this type of project? Speed is
somewhat important, but not extremely.
All comments and advice are welcomed.
Bart 3 2687
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
At 2004-06-02T21:10:02Z, Bart Nessux <ba*********@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 fragments.
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.
- --
Kirk Strauser
The Strauser Group
Open. Solutions. Simple. http://www.strausergroup.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFAvky35sRg+Y0CpvERAkm9AKCOeYJZ3aEbgcFERo8Iy5 dxAKD6aQCeMWEO
bnwx/bkTjkWo+JE/pCrMjvU=
=CmhE
-----END PGP SIGNATURE-----
Thanks for the advice Kirk, I appreciate it.
Kirk Strauser wrote: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
At 2004-06-02T21:10:02Z, Bart Nessux <ba*********@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 fragments.
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. - -- Kirk Strauser The Strauser Group Open. Solutions. Simple. http://www.strausergroup.com/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFAvky35sRg+Y0CpvERAkm9AKCOeYJZ3aEbgcFERo8Iy5 dxAKD6aQCeMWEO bnwx/bkTjkWo+JE/pCrMjvU= =CmhE -----END PGP SIGNATURE-----
Bart Nessux <ba*********@hotmail.com> schreef: Python may not be suitable for this, but I thought I'd ask the experts:
I'm doing a summer project that will attempt to measure exactly how file fragmentation affects disk drive and OS performance. I'd like to use Python for some of this. 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 fragments. For example, assuming that we start with a 100% defragmented drive, run the program to randomly fragment 20% of the drive's files into 7 different fragments (may also base the number of fragments on the file's size).
Anyway, would Python be acceptable for this type of project? Speed is somewhat important, but not extremely.
All comments and advice are welcomed.
Read this: <http://www.sysinternals.com/ntw2k/info/defrag.shtml>
--
JanC
"Be strict when sending and tolerant when receiving."
RFC 1958 - Architectural Principles of the Internet - section 3.9 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Olaf Noehring |
last post by:
Hi
I am the administrator of TSEP - The Search Engine Project (www.tsep.info).
We developer are unclear about the speed of two different methods:
Is it faster to
a) write to a file
or
b)...
|
by: gary |
last post by:
hello everyone,
we dropped the clustered & nonclustered indeces on a table, then
rebuilt them. logical fragmentation is near zero, but extent
fragmentation is about 40%. how can this be if the...
|
by: Tron Thomas |
last post by:
Given the following information about memory management in C++:
-----
The c-runtime dynamic memory manager (and most other commercial memory
managers) has issues with fragmentation similar to a...
|
by: sql-db2-dba |
last post by:
I don't mean that our data grows in an exponential rate. According to
the Adm planning manual, LOB data is stored in segments that are
("powers of 2" * 1024). Wouldn't this mean that the larger...
|
by: Tom |
last post by:
Given: A binary data file of records.
Task: Random access using seekg().
I've never found any documentation stating that the offset from begin
file marker is safe on a fragmented file. I've...
|
by: Chris Mullins |
last post by:
We've been using the SSLStream class found in System.Net.Security to build a
giant Sockets server that provides TLS encryption at the channel leve.
Before .Net 2.0, we used an open-source...
|
by: rcamarda |
last post by:
I thought I would delve into index fragmentation and I found some
great sql from many posters (thanks Erland!).
My question is how bad is bad? I know this is very subjective.
Some scripts I found...
|
by: Andreas Schmitt |
last post by:
Hi,
I recently worked on an open source project and tried to make on of the
arrays they are using dynamically allocated to get rid of the max size.
I used the realloc instead of the usual C++...
|
by: n00m |
last post by:
Both codes below read the same huge(~35MB) text file.
In the file 1000000 lines, the length of each line < 99 chars.
Stable result:
Python runs ~0.65s
C : ~0.70s
Any thoughts?
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |