How to specify multiple exclusion list to xcopy?

 

xcopy is a powerful tool under Windows to do copying. It’s really helpful for me at the time of project deployment. most of of the time, especially with large projects, the binaries, configuration files has to be copied to the deployment folder by excluding the unwanted/ temporary files in the corresponding folders.

It’s possible tp specify the list of files necessary to exclude during an ‘xcopy’ using /EXCLUDE switch. Here’s a simple tip on how to specify multiple exclusion list to the xcopy operation. For e.g you will have to avoid copying .copying obj, .ilk files, Debug, Release folders (if you’ve copied your binaries to a common bin folder) etc..

xcopy /S /I %BIN_HOME%\*.* C:\Delivery\bin /EXCLUDE:excludelist.txt

In the above statement BIN_HOME is an evironment variable. You can also specify exact path to be copied. You can see that at the end of the statement, it’s specified excludefilelist.txt which contains the full path or partial name of files to be excluded. A sample exclude file list may appear as below. Each file to be excluded should be specified in a new line.  At the end you can see to exclude directories, it’s not necessary to specify prefixing . (dot). See the documentation for more information

Sample exclude list file

.pdb
.ilk
.obj
.pch
.exp
.res
.trg
.idb
.tmp
.log
.ncb
.aps
.bsc
.sbr
.scc
Debug
Release

 

How to easily Delete a directory?

 

The Win32 API to delete a directory is RemoveDirectory. But before using this, you will have to delete all the files under the directory and call RemoveDirectory API. If you’ve sub directories under it, it’s necesary to repeat the above steps and finally delete the root directory you’ve specified.

Wait, we’ve a painless API to do this, you don’t have to write code for recursive listing of directories and files while Shell has already provided an API to deal with file Operation.

You can call SHFileOperation as follows

[sourcecode language='cpp']
bool DeleteDirectory( CString strPath )
{
strPath += _T( ‘\ 0′ );

SHFILEOPSTRUCT strOper = { 0 };
strOper.hwnd = NULL;
strOper.wFunc = FO_DELETE;
strOper.pFrom = strPath;
strOper.fFlags = FOF_SILENT | FOF_NOCONFIRMATION;

if ( 0 == SHFileOperation ( &strOper ))
{
return true;
}
return false;

}
[/sourcecode]

 

Project Management and Program Management

 

There are various discussions I heard recently on the responsibilities of Program Manager and Project Manager. In most of the discussions Program manager is much highlighted than project manager while it’s isn’t like that. But of course I believe it’s a glorified title of project management.

In 1980’s Jabe Blumenthal at Microsoft identified this special job to coordinate the engineering efforts with business and marketing side of each division. Program manager will be involved in project from the day one of planning and the last day of testing. It had to be someone who at least technically-respectable by programmers and also at the same time to involve in a broader participation in how the products were made.

An excellent project management book “The Art of Project management” by Scott Berkun has clearly distinguished what’s project management and program management and I think it’s the only book explained about this topic in such a nice way. He define program management as

He’ll be mostly involved in various tasks like writing specifications, reviewing market plans, generating project schedules, leading teams, doing strategy planning, tracking bugs, cultivating team morale and anything else that needed to be done that no one else was doing.

Not every member of the team would report directly to the program manager but he’ll be granted authority to lead and drive the project. In other ways, there will be functional and project reporting points for an individual programmer. I believe we’ve no doubt on the role of project manager.

Even the role Program manager is not defined in many companies, there are many managers doing both project management and program management. Large companies like Microsoft are clearly implemented and has scope for that particular role. But in small companies, dedicated program managers are rare and that role is handled by the project manager and his delegates.

 

Proudly powered by WordPress
Theme: Esquire by Matthew Buchanan.