Skip to content

Instantly share code, notes, and snippets.

View NileshN's full-sized avatar

Nilesh Navale NileshN

View GitHub Profile
@NileshN
NileshN / File Operations
Last active September 22, 2017 10:35
File operations
require 'securerandom'
#------------------------------------------------------------------------------------
# Requirement:
# Read original file of 35mb, it should write 25mb of data to duplicate file.
#------------------------------------------------------------------------------------
original = "/Downloads/all/original.txt"
duplicate = "/Downloads/all/duplicate.txt"
MEGABYTE = 25 * 1024
file2 = File.open(duplicate, 'a')