File Handling

ontent
“w” → write mode (creates file if not exist).

File.read → reads entire file content.

Output in console:


Hello Ruby File!
And file test.txt is created with that text.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *