view matlab/db/dbdrop.m @ 24:27c10ed38592

Added padd.m to remove external dependencies; Matlab output lines now prefixed with '| '
author samer
date Wed, 22 Feb 2012 21:17:52 +0000
parents 0dd31a8c66bd
children
line wrap: on
line source
function dbdrop(loc)
% dbdrop - delete matfile at given locator from matbase
%
% dbdrop :: locator(A) -> action unit.
%
% The files containing the specified locators are deleted from
% the file system. If the file pointed to by the locator does
% not exist, a warning is given but the function completes.

% SA 2008-06 - No longer maps over multiple arguments.

	n=strfind(loc,'|');
	if n>1, matname=loc(1:n-1); else matname=loc; end
	fn=fullfile(dbroot,[matname '.mat']);

	if exist(fn,'file')
		fprintf('*** DELETING FILE: %s\n', fn);
		delete(fn);
	else
		fprintf('*** Warning: %s does not exist\n', fn);
	end