Ruby - File File Size

Introduction

File.size returns the size of a file in bytes.

If the file doesn't exist, an exception is thrown.

Demo

puts File.size("main.rb")

Result

Related Topic