Elton Stoneman

  Home  |   Contact  |   Syndication    |   Login
  120 Posts | 0 Stories | 3607 Comments | 0 Trackbacks

News

Archives

Post Categories

[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.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted on Friday, June 20, 2008 8:00 PM

Feedback

# re: Corrupted Files on Virtual PC Disk 4/9/2010 6:27 AM sozo life
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.

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

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

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

# re: Corrupted Files on Virtual PC Disk 7/8/2010 5:40 AM network backup299
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.

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

# re: Corrupted Files on Virtual PC Disk 7/28/2010 3:29 AM Team National654
Really an interesting post u got there looking forward to see more of it keep it up!

# re: Corrupted Files on Virtual PC Disk 8/25/2010 11:07 AM Sewage Pumps
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.

# re: Corrupted Files on Virtual PC Disk 9/4/2010 2:19 AM Dr.Suresh Mohanty
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.

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


# re: Corrupted Files on Virtual PC Disk 3/4/2011 4:04 AM driving schools in Milton Keynes
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.

# re: Corrupted Files on Virtual PC Disk 3/9/2011 11:23 AM GGBS Transpation
Hi! your website's design is cool and loving it. Your posts are wonderful. Please continue this great work. Cheers!!


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

# re: Corrupted Files on Virtual PC Disk 8/5/2011 5:25 AM Data Backup
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.

# re: Corrupted Files on Virtual PC Disk 11/19/2011 7:54 AM North Face Jackets Sale
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.

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

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: