working chardev in filehandling