local path = "mods/logs/"
local files = file.GetFiles(path)
local is_get_full_path = false
local str, logfilepath, logtxt
if files then
	for i, file_name in pairs(files) do
		if is_get_full_path then break end
		logfilepath = path..file_name
		logtxt = io.open(logfilepath,'r')
		str=logtxt:read()
		while str do
			if string.find(str,'Command line: "') then
				str=string.sub(str,string.find(str,'Command line: "')+15,string.find(str,'payday2_win32_release.exe"')-1)
				log('[auto remove mdmp file]:gamepath='..str)
				is_get_full_path=true
				break
			end
		end
		io.close(logtxt)
	end
end
if is_get_full_path then
	files = file.GetFiles(str)
	for i, file_name in pairs(files) do
		if string.find(file_name,'.mdmp') then
			log("[auto remove mdmp file]]removed file "..file_name)
			os.remove(file_name)
		end
	end
end


        