MATLAB: Is it possible to copy a file on itself

?

hello
i have some files in current folder which were copieed here from other folder. i have changed content of some of them in the original folder and now i want to copy them again to the current folder. but it says u cant copy a file or directory onto itself.
is there anyway for doing this?
thanks

Best Answer

[file,path,indx] = uigetfile( ...
{'*.DATA;*.PVO;*.PVP;*.PVI;*.slx;*.INC','Eclipse Files (*.DATA,*.INC)';
'*.PVO;*.PVP;*.PVI;*.INC','PVTi files (*.PVO,*.PVP,*.PVI)';...
'*.*', 'All Files (*.*)'},'Select a File','MultiSelect', 'on');
if isequal(file,0)
disp('User selected Cancel');
else
if ischar(file); file = {file}; end
file(ismember(file, {'.', '..'})) = [];
file = fullfile(path, file);
for i = 1:length(file)
copyfile(file{i});
end
end
Related Question