se lavori sul file in modalita binaria (rb, wb) dovresti usare fwrite() ed fread()