Fix file operations in c_rehash.