function dirname = ExtractDirName
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% PURPOSE: Extract the current directory name from a full path.
% AUTHOR:  Rob McEwen
% DATE:    00/6/1
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
 mpath     = pwd;
 remainder = mpath;
 
 while (~isempty(remainder))
   [token,remainder]=strtok(remainder,'\');
 end
 dirname = token;
 return;