Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`write': string contains null byte (ArgumentError) #5

Open
dualsoul opened this issue Aug 29, 2012 · 0 comments
Open

`write': string contains null byte (ArgumentError) #5

dualsoul opened this issue Aug 29, 2012 · 0 comments

Comments

@dualsoul
Copy link

The issue is taken from: https://groups.google.com/forum/#!msg/eventmachine/oK74Pc92TvE/TX2lU0QvrBkJ

Below is a snippet which fails with:
./async_write.rb:8:in write': string contains null byte (ArgumentError) from ./async_write.rb:8:inblock (2 levels) in

'
from /usr/local/lib/ruby/gems/1.9.1/gems/eio-0.1/lib/eio/eventmachine.rb:13:in call' from /usr/local/lib/ruby/gems/1.9.1/gems/eio-0.1/lib/eio/eventmachine.rb:13:inpoll'
from /usr/local/lib/ruby/gems/1.9.1/gems/eio-0.1/lib/eio/eventmachine.rb:13:in notify_readable' from /usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:inrun_machine'
from /usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in run' from ./async_write.rb:4:in'

====== async_write.rb =======

require 'eventmachine'
require 'eio/eventmachine'

EM.run do
EIO.eventmachine_handler

EIO.open("./test.txt", EIO::RDWR|EIO::CREAT) do |fd|
EIO.write(fd, "buf contents: \0hello") do |b| # put the zero byte using \0
EM.stop_event_loop
end
end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant