sonic-pi
https://github.com/sonic-pi-net/sonic-pi
C++
Code. Music. Live.
File.atomic_write
Write to a file atomically. Useful for situations where you don't
want other processes or threads to see half-written files.
File.atomic_write('important.file') do |file|
file.write('hello')
end
If your temp directory is not on the same filesystem as the file you're
trying to write, you can provide a different temporary directory.
File.atomic_write('/data/something.important', '/data/tmp') do |file|
file.write('hello')
endEdit
git clone [email protected]:sonic-pi-net/sonic-pi.git
cd sonic-pi
open app/server/ruby/vendor/activesupport-7.0.6/lib/active_support/core_ext/file/atomic.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-File-atomic_write-for-pr
# Commit to gitgit add app/server/ruby/vendor/activesupport-7.0.6/lib/active_support/core_ext/file/atomic.rbgit commit -m "better docs for File.atomic_write"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-File-atomic_write-for-pr
hub pull-request
# Celebrate!