Posted by Jeroen Pluimers on 2014/03/11
.NET DiscUtils is an interesting open source .NET library for accessing and manipulating virtual disk images. Since it is entirely written in C# (without the need for P/Invoke), you should even be able to run this on non-Windows machines using mono. Later on, you will see the 0.11.0 build fails this, but it gives good hope it eventually will.
Virtual disk formats supported are DMG, ISO, RAW (IMG/IMA/VFD/FLP/BIF), VDI, VHD, VHDX, VMDK, and XVA, regular disks like Physical, iSCSI and NFS.
There are two ways of getting the .NET DiscUtils tools to run:
- download pre-build binaries (at the time of writing: version 0.10) from via .NET DiscUtils – Home, or
- from the latest source page, click the download button, then build the binaries from the source package. At the time of writing, that version is 0.11.
This post describes the second way, and requires PowerShell to be installed on your system (which probably is, as Windows 7 and Windows Server 2008 R2 include it). Read the rest of this entry »
Posted in .NET, .NET 4.0, .NET 4.5, C#, C# 4.0, C# 5.0, CommandLine, Development, PowerShell, Software Development | Leave a Comment »
Posted by Jeroen Pluimers on 2014/03/10
Every once in a while you have multiple threads or processes wanting to write a short message to the same log file. Append then will give you an I/O error 32 (ERROR_SHARING_VIOLATION), but the below small routine will sleep a bit while retrying a couple of times.
It uses these Delphi aspects around the $I or $IOCHECKS compiler directive:
- in $I+ mode, you get exceptions when certain “classic” Pascal style I/O operations fail.
- in $I- mode, you access the IOResult to obtain the results of those I/O operations
- IOResult gets the result of the last failed operation (if any) or zero if none failed
- IOResult clears the underlying storage to zero
- $IFOPT checks for a certain state of a compiler flag
- You can store the state of $OPT in a temporary conditional define
Note there are a few tables of codes you can get back through IOResult as basically you can get many GetLastError results in IOResult as well: Read the rest of this entry »
Posted in Delphi, Delphi 1, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Software Development | 2 Comments »