mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
AS guide: specifies that renaming a file is atomic on POSIX systems
This commit is contained in:
parent
81e779a019
commit
d91ac89ab8
1 changed files with 1 additions and 1 deletions
|
@ -2118,7 +2118,7 @@ File.atomic_write(joined_asset_path) do |cache|
|
|||
end
|
||||
</ruby>
|
||||
|
||||
To accomplish this +atomic_write+ creates a temporary file. That's the file the code in the block actually writes to. On completion, the temporary file is renamed. If the target file exists +atomic_write+ overwrites it and keeps owners and permissions.
|
||||
To accomplish this +atomic_write+ creates a temporary file. That's the file the code in the block actually writes to. On completion, the temporary file is renamed, which is an atomic operation on POSIX systems. If the target file exists +atomic_write+ overwrites it and keeps owners and permissions.
|
||||
|
||||
WARNING. Note you can't append with +atomic_write+.
|
||||
|
||||
|
|
Loading…
Reference in a new issue