fixed: fopen flag w -> open file and cat to 0 lenth