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