<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>analog feelings, digital world &#187; my projects</title>
	<atom:link href="http://notonlyzeroesandones.site40.net/category/my-projects/feed/" rel="self" type="application/rss+xml" />
	<link>http://notonlyzeroesandones.site40.net</link>
	<description>code is the modern poetry ;)</description>
	<lastBuildDate>Mon, 05 Oct 2009 22:06:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>What have I learned thanks to SyncToy?</title>
		<link>http://notonlyzeroesandones.site40.net/2009/04/14/what-have-i-learned-thanks-to-synctoy/</link>
		<comments>http://notonlyzeroesandones.site40.net/2009/04/14/what-have-i-learned-thanks-to-synctoy/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 11:58:29 +0000</pubDate>
		<dc:creator>Maciek Talaska</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[my projects]]></category>
		<category><![CDATA[c# 3.0]]></category>
		<category><![CDATA[SyncToy]]></category>
		<category><![CDATA[System.IO]]></category>

		<guid isPermaLink="false">http://notonlyzeroesandones.site40.net/2009/04/14/what-have-i-learned-thanks-to-synctoy/</guid>
		<description><![CDATA[If you haven’t used SyncToy – it is high time to check what it can do for you. In short: this is a great synchronization tool, originally written to help photographers (or amateur photographers) synchronize between their studio storage devices (computers) and mobile data banks. I have started using SyncToy to synchronize content on two [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">If you haven’t used SyncToy – it is high time to check what it can do for you. In short: this is a great synchronization tool, originally written to help photographers (or amateur photographers) synchronize between their studio storage devices (computers) and mobile data banks. I have started using SyncToy to synchronize content on two of my disk (I want one of them to be the exact copy of the other one). The disk are quite big (about 200GBs) so doing a “preview” of changes takes a while. Yesterday although, SyncToy was unable to finish preparing preview, because there were some files / folders with invalid chars in their names. The <a href="http://social.microsoft.com/forums/en-US/synctoy/thread/7c9057ef-c4c7-410c-a3c6-50ff0105988d/">problem is known</a> to both sides: SyncToy users and Microsoft’s developers, but suggested solutions didn’t help me at all (I didn’t know what exact file or directory is causing problems to SyncToy).</p>
<p align="justify">So&#8230; I make a quick look at what can I find inside System.IO, and <a href="http://msdn.microsoft.com/en-us/library/system.io.path.getinvalidpathchars.aspx">Path.GetInvalidPathChars()</a> and <a href="http://msdn.microsoft.com/en-us/library/system.io.path.getinvalidfilenamechars.aspx">Path.GetInvalidFileNameChars()</a> – it seemed that those functions will help me find those files and directories that contains illegal characters. Boy&#8230; I was wrong ;)</p>
<p align="justify">At the beginning I wrote a very simple program (C#) that recursively traversed through all <a href="http://msdn.microsoft.com/en-us/library/system.io.filesysteminfo(VS.71).aspx">FileSystemInfo</a> objects (using <a href="http://msdn.microsoft.com/en-us/library/s7xk2b58.aspx">GetDirectories</a>() and <a href="http://msdn.microsoft.com/en-us/library/ms143327.aspx">GetFiles()</a> methods) present in a given directory. The problem was, that when GetFiles() method was invoked inside a directory that contained files with illegal characters – program crashed (“Illegal Argument Exception”). I couldn’t understand it. I know what was the directory that caused problem and I easily found a file that was a cause of all this mess. The file name contained a pipe “|” character that is not allowed (at least on Microsoft’s systems). </p>
<p align="justify">I wondered how should I change my small utility to make it able to find all illegal files and generate a cute report at the end instead of crashing. I could see the file using Total Commander, Windows Explorer and even dir command executed within cmd.exe. I could – however – copy the file, rename it (tried bazylion of different approaches to achieve this task – using <a href="http://msdn.microsoft.com/en-us/library/aa365247.aspx">Universal Naming Convention</a> didn’t help a bit). I decided to rewrite main part of my utility and to use System.Diagnostics.Process and output of “DIR /A-D /B” for files and “DIR /A:D /B” for directories. My idea was to not checking the names of FileSystemInfo objects that I can get without problems using GetFiles and GetDirectories methods. I assumed (and I hope that it is assumption is correct) that if information about a file or directory can be get, than there is no problem with this object. So I decided that my code should now look more like this:</p>
<pre class="c#" name="code">try
{
    FileInfo[] files = root.GetFiles();
}
catch (System.UnauthorizedAccessException)
{
}
catch
{
    GetSystemEntries(root, EntryType.File);
}</pre>
<p align="justify">In the function that traverses through all the object there is another similar block of code that does similar task but for directories. I wasn’t sure if this approach is ok – exception catching influences performance, but it didn’t take more time than SyncToy to look through all my drive (so I assume that the performance is acceptable). GetSystemEntries is a function written by me, that invokes dir command in specified directory looking for files or directories, and analyzes output (checks if there are any invalid characters in file or directory name).</p>
<p align="justify">Yup, one problem resolved. But what about the file? As far as I remember, it was created by a browser (saving page) and it’s name comes from the title of the page, which was divided in sections using pipes. The funny thing (for me) is that I can not understand how OS may actually allow anyone to create a file with invalid characters in name (I suppose this file was created by Mozilla Firefox 3.0x). I have spent a lot more time looking for a solution how to delete the file, rename it, or do whatever to make it a file with a valid name. Back in the old dos-command-prompt days I used several times a great tool by Norton – diskedit.com – it was very powerful disk editor, that saved me a couple of times. But&#8230; although I found some similar tools, I was a bit too afraid to use them. NTFS is much more complicated than good-old FAT, and I really didn’t want to lose all my data. I rebooted to Ubuntu, and tried renaming. It worked. Then I tried to remove the file. No problems. So&#8230; thank you <a href="http://www.canonical.com/">Cannonical</a> :)</p>
<p align="justify"><a href="http://notonlyzeroesandones.site40.net/my-projects/badfilename/">App sources are available on this blog.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://notonlyzeroesandones.site40.net/2009/04/14/what-have-i-learned-thanks-to-synctoy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BitsMonitor on CodePlex!</title>
		<link>http://notonlyzeroesandones.site40.net/2009/01/28/bitsmonitor-on-codeplex/</link>
		<comments>http://notonlyzeroesandones.site40.net/2009/01/28/bitsmonitor-on-codeplex/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 19:26:26 +0000</pubDate>
		<dc:creator>Maciek Talaska</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[my projects]]></category>
		<category><![CDATA[BitsMonitor]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Codeplex]]></category>

		<guid isPermaLink="false">http://notonlyzeroesandones.site40.net/2009/01/28/bitsmonitor-on-codeplex/</guid>
		<description><![CDATA[I just released BitsMonitor on CodePlex. There is a default release containing 32bit binaries, all the sources are available to download from CodePlex site. I have spent last couple of days preparing first public release of another of my spare-time projects, but it is still not ready. I plan to release it next week. 
BitsMonitor [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">I just released <a href="http://www.codeplex.com/BitsMonitor">BitsMonitor on CodePlex</a>. There is a default release containing 32bit binaries, all the sources are available to download from CodePlex site. I have spent last couple of days preparing first public release of another of my spare-time projects, but it is still not ready. I plan to release it next week. </p>
<p align="justify">BitsMonitor is being released under MIT license (so, you may do anything you want with it, almost everything ;) There is something that bothers me – I have used BITS Interop code provided (as a part of solution attached to an article) by <a href="http://msdn.microsoft.com/en-us/magazine/cc188766.aspx">J.Clark in MSDN Magazine article</a>. And my question is: what is the license of all the sources released as a part of MSDN Magazine articles? Are the sources free? Did I violate the license or not (by including part of J.Clark solution in my own project)? I have found a <a href="http://social.msdn.microsoft.com/Forums/en-US/msdnfeedback/thread/f9636817-8810-4832-a0b2-c0c25a7f4005/">question somewhere on MSDN forum concerning that issue</a>, but there were no answer given. I have contacted J.Clark, but didn’t get any answer until today (almost a week have passed). If you know more about MSDN Magazine licenses for source code – please let me know! </p>
]]></content:encoded>
			<wfw:commentRss>http://notonlyzeroesandones.site40.net/2009/01/28/bitsmonitor-on-codeplex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BitsMonitor &#8211; first project</title>
		<link>http://notonlyzeroesandones.site40.net/2009/01/15/bitsmonitor-first-project/</link>
		<comments>http://notonlyzeroesandones.site40.net/2009/01/15/bitsmonitor-first-project/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 09:22:10 +0000</pubDate>
		<dc:creator>Maciek Talaska</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[my projects]]></category>
		<category><![CDATA[BITS]]></category>
		<category><![CDATA[BitsMonitor]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://notonlyzeroesandones.site40.net/2009/01/15/bitsmonitor-first-project/</guid>
		<description><![CDATA[How should a blog of someone calling oneself software developer be organized? What should it contain? I think, that such a technical blog is not only a great place to share some code snippets or thoughts about programming in general, but it is also a great opportunity to share your projects with broad (I hope [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">How should a blog of someone calling oneself <em>software developer</em> be organized? What should it contain? I think, that such a technical blog is not only a great place to share some code snippets or thoughts about programming in general, but it is also a great opportunity to share your projects with broad (I hope ;) audience. Today I have created special page &#8211; “My Projects” that will contain all my work – I hope that some of you find at least some of them interesting and/or useful.</p>
<p align="justify">First project I have put on there and created special page for &#8211; is called BitsMonitor – it is small utility that uses BITS to download files. You may read more about it on its <a href="http://notonlyzeroesandones.site40.net/my-projects/bitsmonitor/">dedicated page</a>&#8230;</p>
<p align="justify">Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://notonlyzeroesandones.site40.net/2009/01/15/bitsmonitor-first-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
<noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>
<!-- End Of Code -->
