projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
69a117b
)
Make luci.fs.rename work across fielsystems
author
Steven Barth
<steven@midlink.org>
Wed, 12 Nov 2008 12:53:20 +0000
(12:53 +0000)
committer
Steven Barth
<steven@midlink.org>
Wed, 12 Nov 2008 12:53:20 +0000
(12:53 +0000)
libs/core/luasrc/fs.lua
patch
|
blob
|
history
diff --git
a/libs/core/luasrc/fs.lua
b/libs/core/luasrc/fs.lua
index 276e04ec4f396e032a84f42d666a791ad00082ff..abea5b5e80760f1a6099afacc2858c74ed5e8d8f 100644
(file)
--- a/
libs/core/luasrc/fs.lua
+++ b/
libs/core/luasrc/fs.lua
@@
-110,7
+110,14
@@
end
-- @param dest Destination
-- @return Boolean containing true on success or nil on error
function rename(source, dest)
- return os.rename(source, dest)
+ local stat, err, code = os.rename(source, dest)
+ if code == 18 then
+ stat, err, code = copy(source, dest)
+ if stat then
+ stat, err, code = unlink(source)
+ end
+ end
+ return stat, err, code
end
--- Get the last modification time of given file path in Unix epoch format.