ruby 2.2 , how to display the current content of the file? -
in ruby 2.2. script, writing xml file
@filehandle << '<plist version="1.0">' ... @filehandle << "\n<#{element_name}>" ..
during debugging , display current content, how can it's not yet closed, cached ... ? suggestions
byebug @filehandle.class file @filehandle #<file:./albumdata-new.xml>
you can execute these calls in order display content (i assume file opened reading , writing, i.e., mode r+
, w+
or a+
)
@filehandle.flush # make sure written disk @filehandle.seek(0) # can read beginning @filehandle.read # read
Comments
Post a Comment