The next call to doupdate restores the screen to the way it looked in the dump file. If the data is determined to be valid, curses bases its next update of the screen on this information rather than clearing the screen and starting from scratch. It tells the program that the information in filename is what is currently on the screen, and also what the program wants on the screen. This can be thought of as a screen inheritance function.
All routines return the integer ERR upon failure and OK upon success.