Archive for the ‘General’ Category

After creating a windows service, to move a file from one UNC path to another using a FileSystemWatcher, which, in turn,  monitors a UNC path of an FTP folder for a new file,  I received an unexpected error.

I wired up the FileSystemWatcher’s OnCreated event to monitor for the new file. However, when the event fires and the service tries to move the file to another UNC path an IOException exception is thown with a message “The process cannot access the file because it is being used by another process.”

After some investigation, I found that when the file is dropped into the directory, the event OnCreated event is fired, but, at that point, the file is still writing. As a workaround, I caught the exception and when the file is released, it fires the OnChanged event, where I can successfully move the file.

Not the prettiest solution, but it works!  Anyone with any better solutions, let me know.


Two brilliant tools for blogging

Posted: 19th February 2010 in General

These two tools make blogging a whole lot easier than having to fiddle about with formatting in HTML text editors

One: Download Windows Live Writer for editing  and creating blog posts on the most popular blogging sites.

Two: Paste as Visual Studio Code plug–in allows you to paste code in colour format from Visual Studio.