aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/file
diff options
context:
space:
mode:
authorBruno Duyé <brunetton@gmail.com>2009-02-19 21:01:18 -0600
committerJoshua Peek <josh@joshpeek.com>2009-02-19 21:01:18 -0600
commit3668a641702b6d0e5df963f54de8d17c53d6179c (patch)
tree04f9247510a2a4c5999cbd0b1a3173b150e33cf2 /activesupport/lib/active_support/core_ext/file
parentf8ea9f85d4f1e3e6f3b5d895bef6b013aa4b0690 (diff)
downloadrails-3668a641702b6d0e5df963f54de8d17c53d6179c.tar.gz
rails-3668a641702b6d0e5df963f54de8d17c53d6179c.tar.bz2
rails-3668a641702b6d0e5df963f54de8d17c53d6179c.zip
Make atomic_write() puts the check_file in the cache dir, not in application
root [#1962 state:resolved] Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'activesupport/lib/active_support/core_ext/file')
-rw-r--r--activesupport/lib/active_support/core_ext/file/atomic.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/file/atomic.rb b/activesupport/lib/active_support/core_ext/file/atomic.rb
index 976d462e8e..8cc5654a4b 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 @@ module ActiveSupport #:nodoc:
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)