local fileCutil = CTNFileUtil();
local sPath = [[E:/test_class/test_class_4/]];
local sPathDir = [[E:/test_class]];
local help = CSelectHelp();
fileCutil:enumFilesInDirectoryWithFilter('*.txt', sPath, help);
help:addFieldWithData('file_path', '');
for i=help:size()-1,0,-1 do
sTmp = string.gsub(help:vs(i, 'name'), sPath, '');
help:setValueString(i, 'file_path', sTmp);
end
help:dumpEx('=======');
local helpDir = CSelectHelp();
fileCutil:enumAllDirectories(sPathDir, helpDir);
helpDir:addFieldWithData('file_path', '');
for i=helpDir:size()-1,0,-1 do
sTmp = string.gsub(helpDir:vs(i, 'name'), sPath, '');
helpDir:setValueString(i, 'file_path', sTmp);
end
helpDir:dumpEx('=======');
local helpDirPart = CSelectHelp();
fileCutil:enumDirectories(sPathDir, helpDirPart);
helpDirPart:addFieldWithData('file_path', '');
for i=helpDirPart:size()-1,0,-1 do
sTmp = string.gsub(helpDirPart:vs(i, 'name'), sPath, '');
helpDirPart:setValueString(i, 'file_path', sTmp);
end
helpDirPart:dumpEx('=======');
local helpDirFile = CSelectHelp();
fileCutil:enumFilesInDirectory(sPathDir, helpDirFile);
helpDirFile:addFieldWithData('file_path', '');
for i=helpDirFile:size()-1,0,-1 do
sTmp = string.gsub(helpDirFile:vs(i, 'name'), sPath, '');
helpDirFile:setValueString(i, 'file_path', sTmp);
end
helpDirFile:dumpEx('=======');
local helpAssDirFile = CSelectHelp();
fileCutil:enumAllFiles(sPathDir, helpAssDirFile);
helpAssDirFile:addFieldWithData('file_path', '');
for i=helpAssDirFile:size()-1,0,-1 do
sTmp = string.gsub(helpAssDirFile:vs(i, 'name'), sPath, '');
helpAssDirFile:setValueString(i, 'file_path', sTmp);
end
helpAssDirFile:dumpEx('=======');
local helpAssDirFileAll = CSelectHelp();
fileCutil:enumAllFilesWithFilter('*.txt',sPathDir, helpAssDirFileAll);
helpAssDirFileAll:addFieldWithData('file_path', '');
for i=helpAssDirFileAll:size()-1,0,-1 do
sTmp = string.gsub(helpAssDirFileAll:vs(i, 'name'), sPath, '');
helpAssDirFileAll:setValueString(i, 'file_path', sTmp);
end
helpAssDirFileAll:dumpEx('=======');
local sSourcePath = [[E:/test_class/test_class_4/]];
local sDestPath = [[E:/test_class/test_class_4_new/]];
if fileCutil:renameDirectory(sSourcePath, sDestPath) == true then
ui:tip('success');
end