Writing code without ioctl(). Function to write data being written
Working write function.Read function mostly written