Open the file in BINARY fd mode, handle the normal line-ending characters