cd (tempdir ());

## create two files 
id = fopen ("scripta.m", "w+");
fclose (id);
mkdir ("foo");
id = fopen ("foo/scripta.m", "w+");
fclose (id);

addpath (fullfile (tempdir, "foo"));

## delete the first one in the path
file = which ("scripta");
delete (file);
retval = exist ("scripta.m", "file")




