Question 1 of 25
Hints left: 3
Q1
What method is used to check if a file is writable in Ruby?
Q2
What does the 'w' file mode in Ruby signify?
Q3
Which method in Ruby is used to set the position of the file pointer?
Q4
What does the 'r+' file mode in Ruby signify?
Q5
What is the result of using File.open() with the block syntax in Ruby?
Q6
Which method in Ruby is used to read a line from a file?
Q7
Which of the following keywords is used to rescue specific types of exceptions in Ruby?
Q8
What does File.open() return in Ruby when the file is successfully opened?
Q9
How do you open a file in Ruby in write mode, creating it if it does not exist?
Q10
What is the purpose of the retry keyword in Ruby?
Q11
What is the purpose of the File.size method in Ruby?
Q12
Which method in Ruby is used to delete a file?
Q13
What does the 'a+' file mode in Ruby signify?
Q14
What is the purpose of the File.readlines() method in Ruby?
Q15
Which method in Ruby is used to check if the end of a file has been reached?
Q16
What is the purpose of the else keyword in Ruby exception handling?
Q17
How do you check the size of a file in Ruby?
Q18
How do you close a file in Ruby after performing file operations?
Q19
Which method in Ruby is used to write data to a file?
Q20
How do you read the entire contents of a file into a string in Ruby?
Q21
What does the File.rename() method in Ruby do?
Q22
How do you check if a file in Ruby is readable?
Q23
What does the File.exist? method in Ruby return if the specified file exists?
Q24
What is the purpose of the ensure keyword in Ruby exception handling?
Q25
What is the purpose of the File.exist? method in Ruby?