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

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -