mirror of
https://github.com/skywind3000/z.lua
synced 2026-10-20 08:02:27 +00:00
fix: ReplaceFile issue in luajit (windows).
This commit is contained in:
@@ -458,6 +458,7 @@ As you see, z.lua is the fastest one and requires less resource.
|
||||
|
||||
## History
|
||||
|
||||
- 1.7.0 (2019-03-09): Support ranger, fix ReplaceFile issue in luajit (windows).
|
||||
- 1.6.0 (2019-03-04): optimize with ffi module (luajit builtin module).
|
||||
- 1.5.11 (2019-03-02): fixed: os.path.isdir doesn't work for symbol link folders.
|
||||
- 1.5.10 (2019-03-01): Prevent writing file racing.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
-- z.lua - a cd command that learns, by skywind 2018, 2019
|
||||
-- Licensed under MIT license.
|
||||
--
|
||||
-- Version 1.6.0, Last Modified: 2019/03/04 14:47
|
||||
-- Version 1.7.0, Last Modified: 2019/03/09 16:51
|
||||
--
|
||||
-- * 10x faster than fasd and autojump, 3x faster than z.sh
|
||||
-- * available for posix shells: bash, zsh, sh, ash, dash, busybox
|
||||
@@ -1106,7 +1106,10 @@ function data_save(filename, M)
|
||||
fp:close()
|
||||
if tmpname ~= nil then
|
||||
if windows then
|
||||
os.native.ReplaceFile(filename, tmpname)
|
||||
local ok, err, code = os.rename(tmpname, filename)
|
||||
if not ok then
|
||||
os.native.ReplaceFile(filename, tmpname)
|
||||
end
|
||||
else
|
||||
os.rename(tmpname, filename)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user