To execute the script, just invoke
perl syncfolder.pl SOURCE_FOLDER DEST_FOLDER
The tool synchronizes source folder to destination folder, in SVN manner. It does,
- Add files/folders to destination folder which only exist in source folder.
- Delete files/folders from destination folder which only exist in destination folder.
- Override files in destination folder which exist in both source and destination folders and the file content is different. Unlike SVN, it doesn't merge files.
I wrote this tool to copy changed files from my development SVN repository to the publish repository which is hosted on Microsoft Codeplex. If you think it's useful, feel free to use or modify it on your purpose.
In the coming year 2013, I will have very little time and energy on cpgf development. The reason is after some tough hesitation, I decided to switch my daily job to a China oriented company, which culture is having a lot of overtime everyday and even weekend. Apparently I will not have much spare time and energy to work on cpgf massively. That situation will last for at least the whole year 2013.
So cpgf library development will be slow in 2013.
From the first day when I designing the API in cpgf library, I had some design principles in mind and tried to stick with them. In this blog I will show the principles and give some examples.
Please note, none of any principles are found or invented by me. I was inspired by the great book “API Design for C++” and the blog Designing Qt-Style C++ APIs
cpgf library first version was released on 2011, Nov. 05. At the time I writing this blog, 2012, Nov. 24, one year has passed. One year is not quite long time for a long term open source library project, but a lot of development had been done in the year. I will give a review on what happened on cpgf in the last year. Looking back is for better looking forward!
Oh yeah, cpgf library version 1.5.2 was released. Only one and a half months elapsed since previous version 1.5.1, how ever, the new version is an accumulated work in half a year, seriously!
That small problem makes me confirm that it's correct that I always use NULL rather than 0 as null pointer. Below I will explain it.
Today I created a new todo task in the task system. The task is about to add a new type to GVariant to allow GVariant holds both variant data and meta type. Suddenly I had a new idea, why not to use function traits to allow the users to add arbitrary variant types to extend GVariant?
Pseudo C++ code:
// General function to create variant with built-in types // same as how we do now GVariant createVariant(...); // The user may extend to add new variant type for FooClass // The returned GVariant has a new variant type, such as vtFoo GVariant createVariant(const FooClass & fooObject);
I felt excited about the new idea and almost wanted to add a new todo task for it. But then after a while, I realized the idea is completely wrong.
The reason is simple. GVariant must be platform independent and can be transferred across shared modules (DLLs).
That's how GVariant was designed for, similar as the VARIANT type in Windows Component Object Modal (COM). If we allow the users to extend GVariant with arbitrary variant types, we can't guarantee the extended type exists in another module (DLL), and we also can't guarantee the extended type has same size and layout in another module.
Though up to now cpgf is not tested in cross modules environment and it most likely can't work due to the C++ type cast on interfaces, crossing modules is our long term goal and we will definitely implement it one day in the future. So we have to take care about the crossing module ability in the very core component such as GVariant.
Because this is so important and I don't want to forget, I write down this blog to remind myself every time I review the blog.
I've been asked several times if there is any public source control repository that the users can download from, such as git or svn. My answer was and will be always no. I would always stick to provide zip files for download.
The first step to setup the new web site (cpgf.org) for cpgf library is finished now!
I've chosen the great CMS system -- Dokuwiki. Don't be confused, though Dokuwiki was a Wiki system originally, it can be customized to be a great CMS, and the customization can't be simpler.
Dokuwiki is also great for documentation. With Dokuwiki, editing documentation is just same as editing a wiki page. It's just in a breeze! So I will improve documentation more frequently. Don't forget to come back!
Also Dokuwiki can be customized to be a simple blog system. Hope I can often share ideas and thoughts on cpgf library and C++ development from now on!
Now all old cpgf stuff from kbasm.com has been transferred here. So the first step is done.
In coming several weeks, I will work on,
- Polish the land page. Current land page is full of text and quite boring to read.
- Tweak the CSS.
- Release cpgf new version 1.5.0, which will include significantly rewritten of the script binding engine.
- Disclose cpgf library to more public. I didn't announce cpgf to the public at anywhere, now since we have a dedicated web site and the library is more mature, it's time to be more visible.
Let's wait for a more promising future of cpgf library!