rewrote fsopen and fsclose
merged conflict