2 pzheng1 pzheng1 于 2014.10.15 03:04 提问

请问诸位大神,如何用matlab实现不解压,直接复制压缩包中的文件?

请问诸位大神,如何用matlab实现不解压,直接复制压缩包中的文件?我已经实现了不解压,直接得到压缩包中的所有文件命,代码如下:

% Create a Java file of the ZIP filename.
zipJavaFile = java.io.File('ResultLogs_10_20121012_83207.66.zip');
% Create a Java ZipFile and validate it.
zipFile = org.apache.tools.zip.ZipFile('ResultLogs_10_20121012_83207.66.zip')
% Extract the entries from the ZipFile.
entries = zipFile.getEntries

% Initialize the file list.
filelist={};

% Loop through the entries and add to the file list.
while entries.hasMoreElements
filelist = cat(1,filelist,char(entries.nextElement));
end
但是怎么复制出来啊?请指教!多谢!

1个回答

tyutlxf
tyutlxf   2014.12.09 15:32

再循环里加上复制语句,例如:
copyfile('worker.bat','D:/')

Csdn user default icon
上传中...
上传图片
插入图片