?? deletefile.m
字號:
function deletefile(downloadDir,isfromMainIndex)
%DELETEFILE Delete a download directory.
% Copyright 1984-2006 The MathWorks, Inc.
% Author : Santosh Kasula
if (nargin < 2), isfromMainIndex = 0; end
isdirExsting = isdir(downloadDir);
indexPath = fileparts(downloadDir);
if isdirExsting
isOverWrite = questdlg('Are you sure you want to delete the file?','Delete file','Ok','Cancel','Ok');
if isempty(isOverWrite)
isOverWrite = 'Ok';
end
switch lower(isOverWrite)
case 'ok'
cd(indexPath);
rmdir(downloadDir,'s')
case 'cancel'
return
end
end
newfilePath = downloadDir;
for counter = 1:4
[newfilePath newfileName] = fileparts(newfilePath);
indexFilename = dir(fullfile(newfilePath,newfileName,'downloads_index.html'));
if ~isempty(indexFilename) && strcmp(newfileName,'fxdownloads')
updatefxindex(fullfile(newfilePath,newfileName,indexFilename.name),0);
break;
end
end
if isfromMainIndex
web(fullfile(newfilePath,newfileName,indexFilename.name));
else
web(fullfile(fileparts(downloadDir),'downloads_index.html'));
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -