Geeks With Blogs

News This is the *old* blog. The new one is at blog.sixeyed.com
Elton Stoneman
This is the *old* blog. The new one is at blog.sixeyed.com

[Source: http://geekswithblogs.net/EltonStoneman]

One of the nice advantages of developing on a virtual image is that you can set it up with one drive for the OS and another for data. Your dev toolset is ready for project joiners to use, and copying a 15Gb file is far quicker than installing your toolset from nothing. When you want to take work home or on the train with you, it's just a case of zipping up the 1Gb data drive and copying it to your laptop.

I've been doing this using Microsoft Virtual PC once or twice a day for the last few months, and it's somewhere like 99.99% faultless. But that 0.01% fault is manifested as random files being reduced to zero-bytes. They have the correct name and are in the expected location, but are missing their contents. So suddenly a project fails to build as one of the class files is empty.

This seems to be a result of occasionally resizing the .vhd file, rather than with repeatedly zipping and unzipping it. I haven't got an answer for the cause, but the following PowerShell script will output all the zero-length files you have on disk:

##FindZeroByteFiles.ps1

param([string[]] $paths)

function Main

{

foreach ($path in $paths) {

$list = Join-Path $path zeros.txt

Remove-Item $list -ErrorAction SilentlyContinue

get-childitem $path -recurse | sort Length | foreach {

 

if ($_.Length -eq 0) {

$_.FullName >> $list

}

}

}

}

. Main

##

Usage – to list all the zero byte files on drives F and G:

.\FindZeroByteFiles.ps1 F:\,G:\

This will output a file called zeros.txt in the root of each drive specified.

I'll be running it more frequently and I'll update this post if I track down which part of the process is mangling those files in the virtual drive. Or if I get around to writing a heftier script which compares two virtual drives using VHDMount.

Posted on Friday, June 20, 2008 8:00 PM Annoying problems , PowerShell scripts , Virtual PC | Back to top


Comments on this post: Corrupted Files on Virtual PC Disk

# re: Corrupted Files on Virtual PC Disk
Requesting Gravatar...
This one is the blog which I like most,I would like to thanks that master brain who make all this for the readers like me.Thanks a lot for sharing.Keep up the good works.
Left by sozo life on Apr 09, 2010 6:27 AM

# re: Corrupted Files on Virtual PC Disk
Requesting Gravatar...
It sounds like a great application.I am pretty much pleased with your good work.Thanks a lot for sharing.Keep sharing your views.
Left by neways25 on Apr 28, 2010 3:43 AM

# re: Corrupted Files on Virtual PC Disk
Requesting Gravatar...
Pretty informative post and really impressive thinking,I like the presentation and your style of writing.Thanks a lot for sharing.Keep blogging.
Left by scrapbook pages48 on May 20, 2010 8:47 AM

# re: Corrupted Files on Virtual PC Disk
Requesting Gravatar...
It is very interesting article and quite impressive and more informative blog.Each & every tips of your post are awesome.Thanks.Keep it up.
Left by BenchCraft-11 on Jun 14, 2010 3:36 AM

# re: Corrupted Files on Virtual PC Disk
Requesting Gravatar...
Really its one of the fabulous post and I just like to say you,its very informative blog which I like a lot.Keep up the good works.
Left by network backup299 on Jul 08, 2010 5:40 AM

# re: Corrupted Files on Virtual PC Disk
Requesting Gravatar...
Nice post having excellent contents.I have been searching for this type of posts.Thanks a lot.Keep blogging.
Left by team national.33 on Jul 27, 2010 7:11 AM

# re: Corrupted Files on Virtual PC Disk
Requesting Gravatar...
Really an interesting post u got there looking forward to see more of it keep it up!
Left by Team National654 on Jul 28, 2010 3:29 AM

# re: Corrupted Files on Virtual PC Disk
Requesting Gravatar...
I like this concept. I visited your blog for the first time and just been your fan. Keep posting as I am gonna come to read it everyday.
Left by Sewage Pumps on Aug 25, 2010 11:07 AM

# re: Corrupted Files on Virtual PC Disk
Requesting Gravatar...
Interesting topic.And your writing style is super.his is Easy to read that any blogger can follow.All of your magic word really works for the newer blogger.Keep it up.
Left by Dr.Suresh Mohanty on Sep 04, 2010 2:19 AM

# re: Corrupted Files on Virtual PC Disk
Requesting Gravatar...
Thank you very much for that extraordinarily first class editorial! Very creative and innovative one. Keep blogging.
Left by disk backup on Oct 23, 2010 5:28 AM

# re: Corrupted Files on Virtual PC Disk
Requesting Gravatar...
Mac OS X and Microsoft Windows are two most popular computer operating systems. There are some situations, where Macintosh users may need to run Windows based applications. For this purpose, you can use Microsoft Virtual PC as emulation program for PowerPC processor based Mac OS X computers.
Left by driving schools in Milton Keynes on Mar 04, 2011 4:04 AM

# re: Corrupted Files on Virtual PC Disk
Requesting Gravatar...
Hi! your website's design is cool and loving it. Your posts are wonderful. Please continue this great work. Cheers!!
Left by GGBS Transpation on Mar 09, 2011 11:23 AM

# re: Corrupted Files on Virtual PC Disk
Requesting Gravatar...
This is first time I learn about this topic. I appreciate the tips and the recommendation.Thanks.
Left by driving lessons in Lincoln on Apr 13, 2011 10:01 AM

# re: Corrupted Files on Virtual PC Disk
Requesting Gravatar...
I think youve made some truly interesting points. Not too many people would actually think about this the way you just did. Im really impressed that theres so much about this subject thats been uncovered and you did it so well.
Left by Data Backup on Aug 05, 2011 5:25 AM

# re: Corrupted Files on Virtual PC Disk
Requesting Gravatar...
ewBased on the popular brand,the products are always not cheap.So we come to shop but just can only do the window shopping. Especially for the young women and man,we do not get the high salary,but we want the top brand products,just like North Face Jackets, how can I own them? The easy way is finding the North Face clearance or North Face Jackets Sale time.
Left by North Face Jackets Sale on Nov 19, 2011 7:54 AM

# re: Corrupted Files on Virtual PC Disk
Requesting Gravatar...
The only reason that this would happen is because of other corrupt files that might be running on your computer, or low disk space.
Left by tinnitus miracle on Dec 20, 2011 5:59 PM

Your comment:
 (will show your gravatar)


Copyright © Elton Stoneman | Powered by: GeeksWithBlogs.net