Implement LpWriteFile