This morning I was watching a disk defragmenter at work, and thinking about watching the same thing in Win95, and thinking about related stuff like marketing hard disks in base 2 or base 10, cluster size etc.
The Win95 defragmenter didn't give you any choices, on or off, that was it.
The current one gives you lots of choices, by file name, by file modified, by file accessed, and some boot time options.
So how do you create a disk defragmenter?
You'll start with some basics, you need to know about cluster sizes vs file sizes, because this will affect fragmentation, you need to know about other applications accessing the file because you don't want to me moving something that is being read/written to/from at the same time, and you need to know about properties such as file name, file permissions, access and modify markers.
Some of the things that really affect fragmentation, such as cluster size on disk and (if defrag by name is selected) file / directory tree names aren't under your control, you have to adapt to cluster sizes you find just like you have to adapt to users deciding to install windows to C:\windoze.
Then you work out how you actually do it, might be nice to simply move everything to a new drive, wipe the working drive then move stuff back in order, but you can't rely on there being a spare disk of the required capacity, even if the OS would continue to work while you moved it from one disk to another and back again, unless you want to re-write the OS completely so it wasn't dependent upon a particular file being in a particular place, but was happy as long as it could follow a pointer somewhere and end up at the file it required.
In reality you'll need to get your code to work on the same disk as everything else, but you still have lots of choices to make, do you start at the inside tracks and work out, do you start with big files, do you start with small files, do you aggregate free space to make room for operations in advance, or do it on the fly?
Do you, shock horror, spend some time talking tech with hard disk manufacturers and designers and learn the arcane tech details of how hard disks actually work, or do you just treat them as a file or set of protocols at the end of a standardised industry interface?
Do you actually truly know in precise detail what technical goals you are aiming to achieve, or is it just some marketing driven product where fragmented files are bad, non fragmented files are good, and red is the colour of bad, while a soothing blue or green is the colour of good, and all that really matters is whether it is a resource hungry app?
In human terms, with physical paper files in steel drawer filing cabinets in a series of rooms, you have a filing clerk / archivists, who will have a bunch of different card indexes, allowing search and sort by a different criteria for each index, and he will perform file maintenance too.
Anti virus is another form of file maintenance, in the sense that there is good data and everything else.
Only good date has any positive net worth, a virus may have a greater negative net worth than a badly fragmented or broken file, but that will depend more upon the significance of the data contained in a particular file than anything else, and negative is still negative, so the human archivist will address all negative issues, whether it be a dog eared and torn folder to out of order papers in a file.
Back in the day of paper archives, the business lived and died on the efficiency of the human archivists, having worked in some of these places, a tax office tagging every single piece of paper with your personal national insurance / social security number was a good start, add things like dates, references, who wrote it etc and you could rebuild any file system and identify missing papers and being missing, then go look for them.
I also learned technical drawing / draughtsmanship, not to any high degree, as part of my engineering apprenticeship, and a part of that study were some trick questions, one was a square, with a one quarter size square nested inside it, the small square was sat in the centre of the bottom line of the big square, with their lower lines overlapping, this same object was then repeated, and you were told that these were the top and front views, and you had to produce the side view or elevation.
If you followed the rules, strictly, of technical drawing, you got the right answer, the big square was in fact a wedge, and the small square was a cube embedded in the wedge at the blade end.
The ONLY way you could arrive at this answer was to KNOW all the rules of technical drawing, then FOLLOW them implicitly, while ignoring what your brain was thinking and visualising, it was a test of methodology, if you got the right answer your methodology was good, everything else was crap.
Every trade I've ever come across shares this reliance on methodology, from archivist to chemist to anything you can think of, and a fundamental part of the effort in becoming a tradesman was learning to practice and master the methodology, which, when you succeeded, allowed you to make every job you tackled look quite simple and straightforwards to an untrained observer, because every single thing you did had purpose and produced a result on the way to the solution, and you never hesitated and never put a foot wrong or made a mistake, of course it looked simple, there was the art in it.
The tradesman can then instruct the novice to do any task, in a painting by numbers / join the dots fashion, and while slow, the result will come out right.
The crucial factor here is this, the novice, at the end of the task, might be able to repeat the task verbatim, but his knowledge of the rules behind the methodology is still precisely zero.
I got "into" computers in the mid eighties after seeing an early CAD programme, fascinated I was Yoda, but 20+ years later, despite billions of dollars of development and thousands of dollars in price tags for full house applications, there still isn't a single CAD program on the market that follows the rules, they all allow you to draw impossible shapes and then create an equally impossible interpolation in an attempt to square the circle.
I'd be very surprised if any other software were any different.
About ten years ago I was frustrated by software that allegedly calculated marine propeller parameters from input data, they were all utter crap, so sort of being my field and being a task that I used to do manually, I wrote one in Excel. It was crude and had it's issues, but crucially it followed the rules and gave the right answers, and warned you when you were getting into a GIGO (Garbage In, Garbage Out, for the young uns) situation... fundamental was the principle that you needed a few basic items of FACTUAL data, none of them were optional, none of them were guessable or "that's near enough for government work"
This spreadsheet is still out there and being distributed, and many propeller manufacturers are themselves using it (I created it as freeware) though of course there is still a plethora of crap ones out there.
And so we get back to defrag software, and indeed anti-virus software...
Does it do what it says on the tin?
Well, maybe, depends what it says on the tin, does the writing on the tin describe file maintenance in the way that a human archivist can relate to as a set of methodologies, or does the writing on the tin pander to the marketing of the product to the consumer?
Certainly my experience of both de fragmentation software and anti-virus software has been less than stellar, and I must have used them all at some time or another.
None of them have had the same positive effect that a thorough service by a competent mechanic (which is how they are marketed) can have on a motor vehicle, and all of them have sooner or later turned into resource hogs, at least in the sense that the perceived benefits have been outweighed by the perceived negative effects of running them.
Uninstalling said software, complete with obligatory parasitic services that are often harder to kill than MRSA, often produces greater performance and usability benefits than the software itself provides, and there is perhaps the point.
If I install a game or piece of application software such as a word processor or spreadsheet, they are their own ends, the benefits and rewards are self contained, whereas there things like a decent file system sorter and fumigator are not providing any direct rewards, nobody is waiting with bated breath for the torrent seeds for whizzo defrag v4.1 or killum av v 6.4, nor is anyone going to wonder whether the defrag parameters from version 3 of whizzo will still work in 4.1, or the malware / whitelist / intrusiveness profile of killum version 5 will still work in 6.4
Linux doesn't (really) have a defragmenter or an anti-virus (yes, I know, but not in remotely the same way as windows) and I think the reasons *really* have nothing to do with the vox populi answers trotted out, but are far more tightly bound to methodology.
You can't (or you couldn't, back when such courses were actually available) simply learn and pass the Technical Drawing / Draughtsmanship course without absorbing and bunch of other stuff, draughtsmen knew and tensile strengths of materials, fasteners, load bearings, all kinds of stuff, and so they could have meaningful conversations over the blueprints with different specialists, such as the machinist on the shop floor.
Nowadays with the dominance of computers in everything, and particularly windows computers in everything, this has changed...
You can know absolutely bugger all about draughtsmanship, and work on a team coding superCAD, or whizzo defrag, or killum AV, or all three, one contract after the next, and out of work hours have no interests in anything even remotely related to what you do at work.
Take a look at http://www.yadro.de/index.html
This is a guy who has reverse engineered the cheap chinese digital scales, and he has coded his solution to run quite nicely thank you very much in DOS, it could have as easily been running in Linux, but it won't be running is Visual Basic on Vista, because this class of programmer never learnt methodologies, and likely isn't a tinkerer or hacker or old style Popular Mechanics subscriber with a home workshop.
You should not have to use a file defragmenter. The OS should take care of it, on its own, with no 3rd party tools, and with no user intervention. I have used clam for ages. I have yet to find anything but a windows virus (which can't execute anyway) coming in via email.
There are plenty of large, high contrast, readable by old farts, serial LCD displays... These could be driven by a large selection of low cost embedded controllers, PICs and AVRs spring to mind first. The most straight forward path would probably be to keep each axis separate. This way you could use a simpler board than what this guy has, use the larger single line LCD displays, and use a smaller / cheaper microcontroller.
This way you don't need to learn anything about high level programming for Windows, Linux, or whatever... it is more or less like programming C or assembly for DOS. You have nothing to install on an external device, and you aren't depending on some old hunk of junk laptop.
Maybe you are right in that a file defragger shouldn't be something the user should worry about - but someone should still know how to make it, right?
Apart from that, I make use of a lot of command-line parameters in my defragger of choice (JkDefrag), so that it'll put certain types of files first, leave some space at the beginning of the drive because I'm about to install something huge, etc. That's a bit beyond most users' needs from a defragger, though.
Not really, because when it is done automatically by the OS it is done on a file by file basis, when the OS interacts with a file that is over a certain size and fragmented. This is a process that Apple calls "Hot-File-Adaptive-Clustering". This is far simpler than what's going on in Norton Defrag and such. Even a bonehead like myself could probably figure out how to do this efficiently and there's no way I'd take on a project like Norton or MS defrag. (although sitting here with my coffee it occurs to me how to implement some of the features of JkDefrag into the hot file adaptice clustering of Mac OS, I'm not convinced of its true utilities... or perhaps if it is useful it is already there...)
I had not heard of JkDefrag, these days I am forced to use windows because I am rescuing a Labview / Matlab / Excel project, so I'll try this out.
Not really, because when it is done automatically by the OS it is done on a file by file basis, when the OS interacts with a file that is over a certain size and fragmented.
I should clarify - I meant that the OS-integrated process doesn't magically appear - someone has to write it, it has to be updated and playested, and it has to be bugfixed.
OK, but what's your point? UNIX/Linux systems and open source software have more rigor than much of what you find in the Windows world, it's also easier to understand their implementation details. Windows software tends to be easier to use, people get things done quicker, but not as well and often don't understand what they're doing.
May be your argument is that we don't teach people how to work rigorously anymore? May be we realised we don't need as many rigorous people anymore just a few and a bunch of not so smart people clicking buttons randomly. Maybe it's the collapse of Western civilisation or Capitalism... Perhaps it's the beginning of "the new openness" where people realise they have to open their products and designs to criticism in order to build increasingly complex systems.
Maybe we never taught people to work rigorously to begin with, just the select few.
You can know absolutely bugger all about draughtsmanship, and work on a team coding superCAD, or whizzo defrag, or killum AV, or all three, one contract after the next, and out of work hours have no interests in anything even remotely related to what you do at work.
This is a common complaint amongst users of 'custom' written software. It seems to be rare when a dedicated piece of software actually follows and complements a particular workflow.
You hear people ask what the programmers actually know about their world. Do they genuinely know anything about HR, WareHouse Stock management, Medical Best Practice?
I have recently taken on a new contract with a large retail company. After working for Finance and Outsource companies for so long, I expected that I could hit the ground running with a small amount of effort. Talk about having to start again from scratch! My knowledge of Enterprise software means very little when the focus is a POS (point of sale) machine running some very specialised software!
I also see the increasing lack of knowledgeable professionals, replaced by a cheaper employee with software as a supposed solution for knowledge, as a problem.
There is a methodology in my madness...
The Win95 defragmenter didn't give you any choices, on or off, that was it.
The current one gives you lots of choices, by file name, by file modified, by file accessed, and some boot time options.
So how do you create a disk defragmenter?
You'll start with some basics, you need to know about cluster sizes vs file sizes, because this will affect fragmentation, you need to know about other applications accessing the file because you don't want to me moving something that is being read/written to/from at the same time, and you need to know about properties such as file name, file permissions, access and modify markers.
Some of the things that really affect fragmentation, such as cluster size on disk and (if defrag by name is selected) file / directory tree names aren't under your control, you have to adapt to cluster sizes you find just like you have to adapt to users deciding to install windows to C:\windoze.
Then you work out how you actually do it, might be nice to simply move everything to a new drive, wipe the working drive then move stuff back in order, but you can't rely on there being a spare disk of the required capacity, even if the OS would continue to work while you moved it from one disk to another and back again, unless you want to re-write the OS completely so it wasn't dependent upon a particular file being in a particular place, but was happy as long as it could follow a pointer somewhere and end up at the file it required.
In reality you'll need to get your code to work on the same disk as everything else, but you still have lots of choices to make, do you start at the inside tracks and work out, do you start with big files, do you start with small files, do you aggregate free space to make room for operations in advance, or do it on the fly?
Do you, shock horror, spend some time talking tech with hard disk manufacturers and designers and learn the arcane tech details of how hard disks actually work, or do you just treat them as a file or set of protocols at the end of a standardised industry interface?
Do you actually truly know in precise detail what technical goals you are aiming to achieve, or is it just some marketing driven product where fragmented files are bad, non fragmented files are good, and red is the colour of bad, while a soothing blue or green is the colour of good, and all that really matters is whether it is a resource hungry app?
In human terms, with physical paper files in steel drawer filing cabinets in a series of rooms, you have a filing clerk / archivists, who will have a bunch of different card indexes, allowing search and sort by a different criteria for each index, and he will perform file maintenance too.
Anti virus is another form of file maintenance, in the sense that there is good data and everything else.
Only good date has any positive net worth, a virus may have a greater negative net worth than a badly fragmented or broken file, but that will depend more upon the significance of the data contained in a particular file than anything else, and negative is still negative, so the human archivist will address all negative issues, whether it be a dog eared and torn folder to out of order papers in a file.
Back in the day of paper archives, the business lived and died on the efficiency of the human archivists, having worked in some of these places, a tax office tagging every single piece of paper with your personal national insurance / social security number was a good start, add things like dates, references, who wrote it etc and you could rebuild any file system and identify missing papers and being missing, then go look for them.
I also learned technical drawing / draughtsmanship, not to any high degree, as part of my engineering apprenticeship, and a part of that study were some trick questions, one was a square, with a one quarter size square nested inside it, the small square was sat in the centre of the bottom line of the big square, with their lower lines overlapping, this same object was then repeated, and you were told that these were the top and front views, and you had to produce the side view or elevation.
If you followed the rules, strictly, of technical drawing, you got the right answer, the big square was in fact a wedge, and the small square was a cube embedded in the wedge at the blade end.
The ONLY way you could arrive at this answer was to KNOW all the rules of technical drawing, then FOLLOW them implicitly, while ignoring what your brain was thinking and visualising, it was a test of methodology, if you got the right answer your methodology was good, everything else was crap.
Every trade I've ever come across shares this reliance on methodology, from archivist to chemist to anything you can think of, and a fundamental part of the effort in becoming a tradesman was learning to practice and master the methodology, which, when you succeeded, allowed you to make every job you tackled look quite simple and straightforwards to an untrained observer, because every single thing you did had purpose and produced a result on the way to the solution, and you never hesitated and never put a foot wrong or made a mistake, of course it looked simple, there was the art in it.
The tradesman can then instruct the novice to do any task, in a painting by numbers / join the dots fashion, and while slow, the result will come out right.
The crucial factor here is this, the novice, at the end of the task, might be able to repeat the task verbatim, but his knowledge of the rules behind the methodology is still precisely zero.
I got "into" computers in the mid eighties after seeing an early CAD programme, fascinated I was Yoda, but 20+ years later, despite billions of dollars of development and thousands of dollars in price tags for full house applications, there still isn't a single CAD program on the market that follows the rules, they all allow you to draw impossible shapes and then create an equally impossible interpolation in an attempt to square the circle.
I'd be very surprised if any other software were any different.
About ten years ago I was frustrated by software that allegedly calculated marine propeller parameters from input data, they were all utter crap, so sort of being my field and being a task that I used to do manually, I wrote one in Excel. It was crude and had it's issues, but crucially it followed the rules and gave the right answers, and warned you when you were getting into a GIGO (Garbage In, Garbage Out, for the young uns) situation... fundamental was the principle that you needed a few basic items of FACTUAL data, none of them were optional, none of them were guessable or "that's near enough for government work"
This spreadsheet is still out there and being distributed, and many propeller manufacturers are themselves using it (I created it as freeware) though of course there is still a plethora of crap ones out there.
And so we get back to defrag software, and indeed anti-virus software...
Does it do what it says on the tin?
Well, maybe, depends what it says on the tin, does the writing on the tin describe file maintenance in the way that a human archivist can relate to as a set of methodologies, or does the writing on the tin pander to the marketing of the product to the consumer?
Certainly my experience of both de fragmentation software and anti-virus software has been less than stellar, and I must have used them all at some time or another.
None of them have had the same positive effect that a thorough service by a competent mechanic (which is how they are marketed) can have on a motor vehicle, and all of them have sooner or later turned into resource hogs, at least in the sense that the perceived benefits have been outweighed by the perceived negative effects of running them.
Uninstalling said software, complete with obligatory parasitic services that are often harder to kill than MRSA, often produces greater performance and usability benefits than the software itself provides, and there is perhaps the point.
If I install a game or piece of application software such as a word processor or spreadsheet, they are their own ends, the benefits and rewards are self contained, whereas there things like a decent file system sorter and fumigator are not providing any direct rewards, nobody is waiting with bated breath for the torrent seeds for whizzo defrag v4.1 or killum av v 6.4, nor is anyone going to wonder whether the defrag parameters from version 3 of whizzo will still work in 4.1, or the malware / whitelist / intrusiveness profile of killum version 5 will still work in 6.4
Linux doesn't (really) have a defragmenter or an anti-virus (yes, I know, but not in remotely the same way as windows) and I think the reasons *really* have nothing to do with the vox populi answers trotted out, but are far more tightly bound to methodology.
You can't (or you couldn't, back when such courses were actually available) simply learn and pass the Technical Drawing / Draughtsmanship course without absorbing and bunch of other stuff, draughtsmen knew and tensile strengths of materials, fasteners, load bearings, all kinds of stuff, and so they could have meaningful conversations over the blueprints with different specialists, such as the machinist on the shop floor.
Nowadays with the dominance of computers in everything, and particularly windows computers in everything, this has changed...
You can know absolutely bugger all about draughtsmanship, and work on a team coding superCAD, or whizzo defrag, or killum AV, or all three, one contract after the next, and out of work hours have no interests in anything even remotely related to what you do at work.
Take a look at http://www.yadro.de/index.html
This is a guy who has reverse engineered the cheap chinese digital scales, and he has coded his solution to run quite nicely thank you very much in DOS, it could have as easily been running in Linux, but it won't be running is Visual Basic on Vista, because this class of programmer never learnt methodologies, and likely isn't a tinkerer or hacker or old style Popular Mechanics subscriber with a home workshop.