-- begin -- DCIM Download -- local function getfileson(path,hfile) local fd,c,s,fpath,stat,i,tc,ts=os.listdir(path),0,0 if fd~=nil and #fd>0 then for i=1, #fd do fpath=path .. "/" .. fd[i] stat=os.stat(fpath) if stat~=nil then if stat.is_dir==true then if fd[i]~="CANONMSC" then tc,ts=getfileson(fpath,hfile) c=c+tc s=s+ts end elseif stat.is_file==true then hfile:write(path .. "/" .. "|" .. fd[i] .. "|" .. os.date("%Y%m%d%H%M%S", stat.mtime) .. "\n") s=s+(stat.size-1)/4096+1 c=c+1 end end end end return c,s end local function getdcimfiles() local fn,count,size,tc,ts="A/ptpgui.txt",0,0 local file=io.open(fn,"wb") if file then tc,ts=getfileson("A/DCIM",file) count=count+tc size=size+ts file:close() end if count>0 then size=(size-1)/256+1 else size=0 end return count .. "\n" .. fn .. "\n" .. size end -- end -- DCIM Download --