From 3668a641702b6d0e5df963f54de8d17c53d6179c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Duy=C3=A9?= Date: Thu, 19 Feb 2009 21:01:18 -0600 Subject: [PATCH] Make atomic_write() puts the check_file in the cache dir, not in application root [#1962 state:resolved] Signed-off-by: Joshua Peek --- activesupport/lib/active_support/core_ext/file/atomic.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activesupport/lib/active_support/core_ext/file/atomic.rb b/activesupport/lib/active_support/core_ext/file/atomic.rb index 976d462e8e5ff..8cc5654a4bf38 100644 --- a/activesupport/lib/active_support/core_ext/file/atomic.rb +++ b/activesupport/lib/active_support/core_ext/file/atomic.rb @@ -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)