repaired and updated fileFromTo for cython