📄 deletewithsemaphores.m
字号:
function deletewithsemaphores(fileList)
%DELETEWITHSEMAPHORES Delete files using semaphors.
% DELETEWITHSEMAPHORES(FILELIST) deletes the files in cell array FILELIST
% using semaphores.
%
% Example:
% fileList = {'test1.txt', 'text2.txt'};
% deletewithsemaphores(fileList);
%
% Markus Buehren
% Last modified 21.04.2008
%
% See also SETFILESEMAPHORE, REMOVEFILESEMAPHORE.
if ischar(fileList)
fileList = {fileList};
end
for fileNr = 1:length(fileList)
sem = setfilesemaphore(fileList{fileNr});
if exist(fileList{fileNr}, 'file')
delete(fileList{fileNr});
end
removefilesemaphore(sem);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -