提交 3668a641 编写于 作者: B Bruno Duyé 提交者: Joshua Peek

Make atomic_write() puts the check_file in the cache dir, not in application

root [#1962 state:resolved]
Signed-off-by: NJoshua Peek <josh@joshpeek.com>
上级 f8ea9f85
......@@ -27,7 +27,7 @@ def atomic_write(file_name, temp_dir = Dir.tmpdir)
old_stat = stat(file_name)
rescue Errno::ENOENT
# No old permissions, write a temp file to determine the defaults
check_name = ".permissions_check.#{Thread.current.object_id}.#{Process.pid}.#{rand(1000000)}"
check_name = join(dirname(file_name), ".permissions_check.#{Thread.current.object_id}.#{Process.pid}.#{rand(1000000)}")
open(check_name, "w") { }
old_stat = stat(check_name)
unlink(check_name)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册