Commit 2b90fa2b authored by Renato Figueiro Maia's avatar Renato Figueiro Maia

(MERGE) sdk/lua/branches/02_00_01 [168805]


git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/openbus/sdk/lua/trunk@169196 ae0415b3-e90b-0410-900d-d0be9363c56b
parents ed088e82 6e82a8c3
-- $Id$
local _G = require "_G"
local assert = _G.assert
local ipairs = _G.ipairs
......@@ -101,9 +99,14 @@ local function saveto(path, ...)
local code
result, errmsg, code = renamefile(temp, path)
if result == nil then
if errmsg == "File exists" and code == 17 then
if errmsg:find("File exists", 1, true) and code == 17 then
---[[
assert(removefile(path))
result, errmsg = assert(renamefile(temp, path))
--[=[--]]
result, errmsg = assert(renamefile(path, path .. ".delete.me"))
assert(removefile(path .. ".delete.me"))
--]=]
result, errmsg = renamefile(temp, path)
else
errmsg = "unable to replace file '"..path.."' (with file "..errmsg..")"
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment