I am new programmar in Ruby. Can someone take an example about opening file with r+,w+,a+ mode in Ruby? What is difference between them and r,w,a?
Please explain, and provide an example.
I am new programmar in Ruby. Can someone take an example about opening file with r+,w+,a+ mode in Ruby? What is difference between them and r,w,a?
Please explain, and provide an example.
The file open modes are not really specific to ruby - they are part of IEEE Std 1003.1 (Single UNIX Specification). You can read more about it here:
http://pubs.opengroup.org/onlinepubs/009695399/functions/fopen.html
Any mode that contains the letter 'b' stands for binary file. If the 'b' is not present is a 'plain text' file.
The difference between 'open' and 'open for update' is indicated as: