创建文件夹
--加入判断文件夹是否存在 if not self:FloaderIsIn(path) then os.execute("mkdir "..avatarShowPath..v) end --判断返回是否存在当前文件夹 local function FloderIsin(path) local file = io.open(path,"rb") if file then file:close() end return file ~= nil end
复制文件
--参数oldPath是旧文件的路径包含文件名,newPath则是新文件的路径包含文件名 function P:CopyIcon(oldPath,newPath) local oldIcon,errorString = io.open(oldPath,"rb") assert(oldIcon~=nil , errorString) local data = oldIcon:read("a") oldIcon:close() local newIcon = io.open(newPath,"wb") newIcon:write(data) newIcon:close() end