Sha256: 3553ece597731acfa0e86299d280085414aed1456de07913f44280e91298602c
Contents?: true
Size: 898 Bytes
Versions: 5
Compression:
Stored size: 898 Bytes
Contents
# this method adds a new record def savegutenbergrecord require 'fileutils' if ! @a_viewgutenberg.to_s.empty? fileName = $rwdgutenberg_directory + "/" + @a_viewgutenberg.to_s + ".gut" # grab the new filename to create a_gutenbergdata = @a_gutenbergdatapath.to_s.rstrip+ "\n" + @a_gutenbergdatainfo.to_s + "\n" + @a_gutenbergdatalocation.to_s + "\n" + @a_gutenbergdatalines.to_s + "\n" + @a_gutenbergdataspeed.to_s + "\n" + @a_gutenbergdatacomments.to_s + "\n" begin # exception trapped block puts a_gutenbergdata fd = File.open(fileName,"w") fd.print( a_gutenbergdata) # save the record info to the file fd.close rescue SystemCallError, StandardError $stderr.print "system call error: " + $! end # exception rescue end end
Version data entries
5 entries across 5 versions & 1 rubygems