knowing file operation in ruby