working on fgetattr