Vidyalelo
Ruby Programming · all questions

File Input Output in Ruby
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

33

Questions

2/2

Page

Pick an option on a question to see the right answer and solution.

How do you check the size of a file in Ruby?

Select an option to see the answer and solution.

Which method is used to delete a file in Ruby?

Select an option to see the answer and solution.

What does the binmode method do in Ruby file I/O?

Select an option to see the answer and solution.

How can you check if a file is readable in Ruby?

Select an option to see the answer and solution.

What does the truncate method do in Ruby file I/O?

Select an option to see the answer and solution.

Which method is used to check if a file is executable in Ruby?

Select an option to see the answer and solution.

How can you get the absolute path of a file in Ruby?

Select an option to see the answer and solution.

What does the fcntl method do in Ruby file I/O?

Select an option to see the answer and solution.

How do you create a new directory in Ruby?

Select an option to see the answer and solution.

What is the purpose of the chown method in Ruby file I/O?

Select an option to see the answer and solution.

Which method is used to check if a file is hidden in Ruby?

Select an option to see the answer and solution.

What does the ctime method return in Ruby file I/O?

Select an option to see the answer and solution.

Which method is used to retrieve file attributes in Ruby?

Select an option to see the answer and solution.