Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!
the ui leaves room for imptovement..
I thought I would add some file aging capabilities to a logger class as an lower bound guarantee. I thought it would be nice to use the creation time of a file to keep track, bad idea, this is why.
It had to be platform agnostic so I set about trying to implement it in Windows first. I wrote all the code and ran the unit test. To my amazement sometimes the unit test failed some times it worked. Actually most of the time it failed. I started debugging it and found to my surprise that the creation date of the file somehow carried forward when a fast delete/create of a file at the same location with the same name was done. I swiftly turned to the MSDN doc and read it more closely for CreateFile and what would you know, it is a documented feature. A small line among a few hundred, not very precise either.
“If you rename or delete a file and then restore it shortly afterward, the system searches the cache for file information to restore. Cached information includes its short/long name pair and creation time.”
How odd? Who came up with that idea. Well that someone even came up with a name is called File System Tunneling
Once again the reason is backward compatibility, to MS-DOS!
“The idea is to mimic the behavior MS-DOS programs expect when they use the safe save method. They copy the modified data to a temporary file, delete the original and rename the temporary to the original. This should seem to be the original file when complete. Windows performs tunneling on both FAT and NTFS file systems to ensure long/short file names are retained when 16-bit applications perform this safe save operation”
All you people complaining that Vista breaks things, you should instead rejoice and be happy that we are finally getting rid of more and more legacy idiocies such as this (although this is still in Vista and Windows 7).
Either way, I ended up setting the creation time upon creation of a file. Finally done I thought.
Well things get even worse in unix. Unix file systems generally don’t track creation times. You could fake it through the i-node time stamp (through fsdb) however if a new i-node is created for whatever reason the time stamp will be updated. Not very reliable. FreeBSD apparently tracks it as birth time, all in all, as so very often in the unix land, it is a mess and no real set standard.
I played around in a few different distros to try to figure out a solution, but found none. So.. if anyone happen to read this and know what to do feel free to share.
For now I will have to resort to the very tacky thing of reading the date from the first log row in the file and cache that… Not really a performance problem as this is part of a syslog service that is running all the time, so generally it will only be needed upon restart.
Since I mentioned tine Windows 7 engineering blog in my last post I want to continue on that topic just a little bit longer. For those really interested in what happens inside many of the Microsoft’s products have a look at Channel 9
Especially hot right now for developer is this
Also the entire PDC can be viewed here:
The other day spotify blessed this world and today I witnessed a “new” Microsoft. A Microsoft that finally gets into the fray and combats the blogosphere, handling feedback and giving facts.
It all started a few months ago when the Windows 7 engineering blog was started. I was very excited about that announcement and what it promised to deliver. An inside view (at least as close as you can get) on the engineering process and thoughts behind the design decisions in Windows 7. It has been a very good read so far and I wish a lot more people would read it. Especially many out there in the blogosphere in the hopes that it would get many debates back to talking about facts and being constructive instead of religious bickering.
In the last few days a heated discussion started to form about, a weakness if you will, in the UAC system in windows 7. People realized that it was possible to change the UAC level without being elevated. A lot of people pointed this out and Microsoft response was somewhat peculiar as it took a defensive position, a high horse approach, this is not a bug. That was what it felt like and everyone was thinking, they are missing the point (again). Today all of us were proven wrong
I know not one man changes the face of a company, but Steven Sinofsky is doing an excellent job in the communication department I hope this is what we can expect from Microsoft for all products in the future. We technical people need all the help we can get to communicate clearly, I know for sure I do =)
Let’s hope they don’t get hubris (like a few years ago) and instead stays true to this new open path.
Sometimes the world surprises you, sometimes it is one of those moments when the world takes a slight step forward towards a better place. Today was such a day when I was introduced to Spotify (not to mention the iTunes drops DRM!)
An online music service with an already vast directory of online music(even if the service is just months old), with many of the worlds’ artists. Some notable artists have decided to opt out of this unfortunately, but I am sure they will come around when they realize the potential this has.
The basic service is free and commercialized. A subscription costs a mere 99kr per month. That’s less than one CD a month! But it is also a good trick to get me to buy at least 8 CDs a year. More than I do now (not by much but still) which is wherein the trick lies, many small expenses are an evil way to increase people’s spending as it creeps in, but in this case I applaud it!
On the upside I get to chose exactly what to listen to and find new genres to appreciate. Now if they would only add the ability to donate to the artists right from the app too!
Hopefully this will be a start of the end of DRM which sucks valuable money (not counting the valuable processor cycles on my computer..) out of the hands of the ones that should get them. The performers.
What would you know, it was founded in Sweden too!
Now if it would only come to the mobile as well. Will help Ericsson too =) as the capacity increase needed might explode finally and perhaps also push prices of roaming mobile broadband across Europe to a more acceptable level. Oh well one can dream!
If you happen to have to restore a windows machine that isn’t booting any longer (god forbid!) these tools can come in handy
As well if you are managing a center of public computers this might be useful
Have fun restoring!