Added write to file feature

Signed-off-by: Siddharth Goel <siddharth98391@gmail.com>