Methods

FileUtils


Public Class Methods

concat( src, dest ) click to toggle source

Concatenate the contents of the src file to the end of the dest file. If the dest file does not exist, then the src file is copied to the dest file using copy_file.

     # File lib/logging/utils.rb, line 187
187:   def concat( src, dest )
188:     if File.exist?(dest)
189:       bufsize = File.stat(dest).blksize || 8192
190:       buffer = String.new
191: 
192:       File.open(dest, 'a') { |d|
193:         File.open(src, 'r') { |r|
194:           while bytes = r.read(bufsize, buffer)
195:             d.syswrite bytes
196:           end
197:         }
198:       }
199:     else
200:       copy_file(src, dest)
201:     end
202:   end

Private Instance Methods

concat( src, dest ) click to toggle source

Concatenate the contents of the src file to the end of the dest file. If the dest file does not exist, then the src file is copied to the dest file using copy_file.

     # File lib/logging/utils.rb, line 187
187:   def concat( src, dest )
188:     if File.exist?(dest)
189:       bufsize = File.stat(dest).blksize || 8192
190:       buffer = String.new
191: 
192:       File.open(dest, 'a') { |d|
193:         File.open(src, 'r') { |r|
194:           while bytes = r.read(bufsize, buffer)
195:             d.syswrite bytes
196:           end
197:         }
198:       }
199:     else
200:       copy_file(src, dest)
201:     end
202:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.