Friday, 20 July 2007

Command Line Library Minor Update (

This release replaces the need of inheriting from ValueContainer class with the use of the new ValueListAttribute. This levels the programming model making the OO design more coherent.
As can use the OptionAttribute for define an option to parse:

class Options {

[Option ("o", "output")]
public string OutputFilename;

Now you can use the ValueListAttribute to store non-option values:

class Options {

[Option ("o", "output")]
public string OutputFilename;

[ValueList (typeof (List<string>))]
public IList<string> InputFilenames;

You must apply this new attribute to a field defined as IList<string> and define a compatible concrete instance type for the attribute constructor. This allows a good degree of customization without making more complex the programming model.
The release also features some internal rectoring and thread safety when modifying the options instance.

Give it a try.

Tuesday, 17 July 2007

Backup and Virtual Machine Images

In a development environment is now common the use of virtualization software for different reasons (testing the application in an another OS, made an IDE available to an OS that lacks that software, etc).
When I create a fresh guest installation, I like to backup the virtual disk image. If the virtualization app doesn't allow you to split the virtual disk in smaller files (like VMWare does), you have to do it by your self. If you don't split images greater than 2GB, you will exceed the ISO filesystem maximum allowed size.
In linux (or in Windows with Cygwin) you can use the split command to reduce these images:

split -db100000000 big_file.ext big_file.ext-

The number is a 1 followed by 8 zeroes and is expressed in bytes ('b' option), the 'd' switch tells split to use numeric suffix and the third parameter is the prefix. This command will produce n-files of 100MB named big_file.ext-00, big_file.ext-01, etc.
To join these file use the following command:

cat big_file.ext-* >big_file.ext

For completeness I must say that UDF filesystem supports files greater than 2GB, but in linux I had some problems with udftools (some blog post talks about a bug that limits again the file size - I've verified and it's true).

If you are searching a good virtualization product you can try VirtualBox. It's available in an opensource edition under GPL license.

Tuesday, 10 July 2007

Command Line Library Minor Update (

I've published a minor update ( that concerns maintainability. From this point I've planned some improvements for complete the project.
I'd like to add usage message creation and a class derived from OptionAttribute that works with arrays for handle non-option arguments (insted of ValueContainer).

What's more? I'd like to hear your opinion about the code...