search for: syswrite

Displaying 17 results from an estimated 17 matches for "syswrite".

Did you mean: sys_write
2007 Jan 08
1
delete a file from the server
...the vcs file to be saved in the serve. when i am trying to delete the file from the server it is throwing the error,"Cannot start Microsoft Outlook.Cannot import vCalendar file". here is the code that i am using. def vcs f = File.open("txt_name.vcs","w+") f.syswrite("BEGIN:VCALENDAR\n") f.syswrite("PRODID:-//Microsoft Corporation//Outlook MIMEDIR//EN\n") f.syswrite("VERSION:1.0\n") f.syswrite("BEGIN:VEVENT\n") f.syswrite("DTSTART:20070105T210000Z\n") f.syswrite("DTEND:20070105T230000Z\n...
2005 Dec 13
3
send_file doesn't work with Apache?...
Hi, I''ve been using send_file in my Rails application with WEBrick happily to send files of various sizes and kinds. The same code fails to send anything but a 500 error when run under Apache, and a log file message "warning: syswrite for buffered IO". Looking back through the mailing list archives I see that there have been send_file bugs in the past. Can some knowledgeable person tell me if these problems are still unfixed for Rails application using Apache? Cheers, Stu
2007 Feb 22
0
error with send_file.. please help me...
...ptions[:stream] render :text => Proc.new { |response, output| logger.info "Streaming file #{path}" unless logger.nil? len = options[:buffer_size] || 4096 File.open(path, ''rb'') do |file| if output.respond_to?(:syswrite) begin while true output.syswrite(file.sysread(len)) end rescue EOFError end else while buf = file.read(len) output.write(buf) end...
2013 Nov 05
4
Handling closed clients
...is not ignored + def test_eof_app + teardown + app = lambda { |env| raise EOFError } + # [200, {}, []] } + redirect_test_io do + @server = HttpServer.new(app, :listeners => [ "127.0.0.1:#@port"] ) + @server.start + end + sock = TCPSocket.new(''127.0.0.1'', @port) + sock.syswrite("GET / HTTP/1.0\r\n\r\n") + assert_match %r{\AHTTP/1.[01] 500\b}, sock.sysread(4096) + assert_nil sock.close + lines = File.readlines("test_stderr.#$$.log") + assert lines.grep(/app error:/) + end + + def test_file_streamed_request_close + teardown + # do a funky dance so that t...
2005 Dec 20
0
2005 a send_file odyssey (or Rails and Apache don''t always play well)...
...ent-Length header is missing. What gives? Curious, I try the 350MB download: Firefox (OS/X) : 500 internal server error Looking at the Apache error logs I see (long line wrapped): /opt/ruby-1.8.2/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ action_controller/streaming.rb:71: warning: syswrite for buffered IO Which makes me think Rails or Ruby are trying to do low level system writes to a buffered IO stream. My next step is to copy the method referred to in the log message and change it to ensure it doesn''t use low level writes: def my_send_file(path, options =...
2007 Feb 23
1
How to make Rails send a file that is being written
...er = false if options[:stream] render :text => Proc.new { |response, output| logger.info "Streaming file #{path}" unless logger.nil? len = options[:buffer_size] || 4096 File.open(path, ''rb'') do |file| if output.respond_to?(:syswrite) begin while true output.syswrite(file.sysread(len)) end rescue EOFError end else while buf = file.read(len) output.write(buf) end end end } el...
2008 Dec 02
18
How to dig deeper
In order to get more information on IO performance problems I created the script below: #!/usr/sbin/dtrace -s #pragma D option flowindent syscall::*write*:entry /pid == $1 && guard++ == 0/ { self -> ts = timestamp; self->traceme = 1; printf("fd: %d", arg0); } fbt::: /self->traceme/ { /* elapsd =timestamp - self -> ts; printf("
2006 Aug 17
1
sysread error in "net" library?
Hi, I am reading RSS feeds and quite often I get the following error in the "net" library. Anybody had such error before? Any info would be very useful? Thanks, Hari ----- /usr/lib/ruby/1.8/net/protocol.rb:133:in `sysread'': end of file reached (EOFError) from /usr/lib/ruby/1.8/net/protocol.rb:133:in `rbuf_fill'' from /usr/lib/ruby/1.8/timeout.rb:56:in
2006 Mar 03
0
send_file bug
...em with the send_file method. I saw that some of you had the same problem but with no real solution/explanation first problem the :stream options, and not ''streaming'' as I see in some doc or book. the second problem : when you set :stream to true, there''s a use of syswrite that should not be. I detailed this in response to a ticket opened by stuart hungerford : http://dev.rubyonrails.org/ticket/3302 I would like to have your opinions on a better solution or a real solution. thanks Jean-Marc Delafont --------------------------------- Nouveau : t?...
2007 May 23
4
Error when posting form
...equest-header: referer => https://censored.com/dealerApply/ request-header: accept-charset => ISO-8859-1,utf-8;q=0.7,*;q=0.7 request-header: content-length => 47 request-header: keep-alive => 300 Errno::EPIPE: Broken pipe from /usr/local/lib/ruby/1.8/openssl/buffering.rb:178:in `syswrite'' from /usr/local/lib/ruby/1.8/openssl/buffering.rb:178:in `do_write'' from /usr/local/lib/ruby/1.8/openssl/buffering.rb:192:in `write'' from /usr/local/lib/ruby/1.8/net/protocol.rb:175:in `write0'' from /usr/local/lib/ruby/1.8/net/pro...
2010 Feb 18
2
[PATCH 1/2] ESX: Look harder for potential transfer failures
...die(user_message(__x("Authentication error connecting to ". "{server}. Used credentials for {username} ". @@ -185,6 +194,8 @@ sub handle_data my $volfh = $self->{_v2v_volfh}; + $self->{_v2v_received} += length($data); + syswrite($volfh, $data) or die(user_message(__x("Error writing to {path}: {error}", path => $self->{_v2v_volpath}, @@ -205,6 +216,7 @@ sub create_volume unless (defined($name)); my $size = $response->content_length(); + $self-&g...
2010 Jul 01
1
Interesting "Bad Certificate" Problem
...ib/ruby/site_ruby/1.8/puppet/application.rb:306:in `exit_on_fail'' /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:217:in `run'' /usr/sbin/puppetmasterd:66 [2010-07-01 13:27:31] ERROR OpenSSL::SSL::SSLError: SSL_write:: internal error /usr/lib/ruby/1.8/openssl/buffering.rb:178:in `syswrite'' /usr/lib/ruby/1.8/openssl/buffering.rb:178:in `do_write'' /usr/lib/ruby/1.8/openssl/buffering.rb:197:in `<<'' /usr/lib/ruby/1.8/webrick/httpresponse.rb:324:in `_write_data'' /usr/lib/ruby/1.8/webrick/httpresponse.rb:296:in `send_body_string'' /usr/lib...
2007 Apr 25
5
Upload PDF / Save as tiff
...le. IO.popen(''c:\program files\gs\gs8.56\bin\gswin32c.exe -q -dNOPAUSE -dBATCH -sDEVICE=tiffg4 -sOutputFile=- -'', "wb+") do |pipe| pipe.write pdf_data pipe.close_write tiff_data = pipe.read open(''test1.tiff'', ''wb'') { |f| f.syswrite tiff_data } end Is it not possible to receive binary data correctly from the pipe? I''ve tested on both XP (ruby 1.8.4) and Linux (ruby 1.8.4). Thanks for any advice you can offer. Regards, Rich Duzenbury --~--~---------~--~----~------------~-------~--~----~ You received this message...
2010 Mar 30
3
[PATCH 1/2] Refactor guest and volume creation into Sys::VirtV2V::Target::LibVirt
...ening storage volume {path} ". + "for writing: {error}", error => $!))); + + $self->{fd} = $fd; +} + +sub write +{ + my $self = shift; + my ($data) = @_; + + defined($self->{fd}) or die("write called without open"); + + syswrite($self->{fd}, $data) + or die(user_message(__x("Error writing to {path}: {error}", + path => $self->get_path(), + error => $!))); +} + +sub close +{ + my $self = shift; + + close($self->{fd}) +...
2010 Jan 29
4
[FOR REVIEW ONLY] ESX work in progress
The following patches are where I'm currently at with ESX support. I can now import a domain from ESX along with its storage. Note that I'm not yet doing any conversion. In fact, I've never even tested past the import stage (I just had an exit in there). The meat is really in the 4th patch. The rename of MetadataReader->Connection was because the Connection is now really providing
2010 Feb 01
9
[ESX support] Working ESX conversion for RHEL 5
With this patchset I have successfully[1] imported a RHEL 5 guest directly from ESX with the following command line: virt-v2v -ic 'esx://yellow.marston/?no_verify=1' -op transfer RHEL5-64 Login details are stored in ~/.netrc Note that this is the only guest I've tested against. I haven't for example, checked that I haven't broken Xen imports. Matt [1] With the exception of
2010 Sep 21
1
[PREVIEW ONLY] Refactor data transfer code
...ening storage volume {path} ". - "for writing: {error}", error => $!))); - - $self->{fd} = $fd; -} - -sub write -{ - my $self = shift; - my ($data) = @_; - - defined($self->{fd}) or die("write called without open"); - - syswrite($self->{fd}, $data) - or die(user_message(__x("Error writing to {path}: {error}", - path => $self->get_path(), - error => $!))); -} - -sub close -{ - my $self = shift; - - close($self->{fd}) -...