OS-independent file saving