Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…ication

root [#1962 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
  • Loading branch information...
commit 3668a641702b6d0e5df963f54de8d17c53d6179c 1 parent f8ea9f8
Bruno Duyé brunetton authored josh committed
Showing with 1 addition and 1 deletion.
  1. +1 −1  activesupport/lib/active_support/core_ext/file/atomic.rb
2  activesupport/lib/active_support/core_ext/file/atomic.rb
View
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.