find out if a file has a length of zero (0) with zero?: : size « File Directory « Ruby






find out if a file has a length of zero (0) with zero?:


system("touch chap.txt") # Create a zero-length file with a system command
File.zero?( "chap.txt" ) # => true

 








Related examples in the same category

1.Get its size in bytes with size? or size:
2.Getting the Size of a File
3.Get file size?