A controller for controlling equipment or a machine, the controller comprising: a volatile storage ; a single nonvolatile storage ; an auxiliary power supply configured to feed power at a power cut when power fed from an external power supply is cut; and a control unit configured to generate power-cut retaining information to be retained at the power cut, and store the generated power-cut retaining information into the volatile storage , the control unit including a file system unit configured to read and write target information from and into the nonvolatile storage , wherein the single nonvolatile storage includes a first area and a second area, the control unit including a program execution unit configured to designate the first area or the second area into which the target information is written, in accordance with the priority of the target information, wherein a user program executed by the program execution unit is configured to place a priority to some items of the target information that is higher than the priority of the power-cut retaining information , when receiving a power cut notification indicating a cut of power fed from the external power supply while reading or writing target information from or into the first area, the file system unit is configured to stop reading or writing the target information from or into the first area, and to write the power-cut retaining information stored in the volatile storage into the single nonvolatile storage using power fed from the auxiliary power supply , and when receiving the power cut notification while reading or writing target information having the higher priority than the power-cut retaining information from or into the second area, the file system unit is configured to continue to read or write the target information from or into the second area. a volatile storage ; a single nonvolatile storage ; an auxiliary power supply configured to feed power at a power cut when power fed from an external power supply is cut; and a control unit configured to generate power-cut retaining information to be retained at the power cut, and store the generated power-cut retaining information into the volatile storage , the control unit including a file system unit configured to read and write target information from and into the nonvolatile storage , wherein the single nonvolatile storage includes a first area and a second area, the control unit including a program execution unit configured to designate the first area or the second area into which the target information is written, in accordance with the priority of the target information, wherein a user program executed by the program execution unit is configured to place a priority to some items of the target information that is higher than the priority of the power-cut retaining information , when receiving a power cut notification indicating a cut of power fed from the external power supply while reading or writing target information from or into the first area, the file system unit is configured to stop reading or writing the target information from or into the first area, and to write the power-cut retaining information stored in the volatile storage into the single nonvolatile storage using power fed from the auxiliary power supply , and when receiving the power cut notification while reading or writing target information having the higher priority than the power-cut retaining information from or into the second area, the file system unit is configured to continue to read or write the target information from or into the second area. <EOS>