Like rdbLoadRio() but takes a filename instead of a rio stream. The * filename is open for reading and a rio stream object created in order * to do the actual loading. Moreover the ETA displayed in the INFO * output is initialized and finalized. * * If you pass an 'rsi' structure initialied with RDB_SAVE_OPTION_INIT, the * loading code will fiil the information fields in the structure. */
| 3576 | * If you pass an 'rsi' structure initialied with RDB_SAVE_OPTION_INIT, the |
| 3577 | * loading code will fiil the information fields in the structure. */ |
| 3578 | int rdbLoadFile(const char *filename, rdbSaveInfo *rsi, int rdbflags) { |
| 3579 | FILE *fp; |
| 3580 | rio rdb; |
| 3581 | int retval; |
| 3582 | |
| 3583 | if ((fp = fopen(filename,"r")) == NULL) return C_ERR; |
| 3584 | startLoadingFile(fp, filename,rdbflags); |
| 3585 | rioInitWithFile(&rdb,fp); |
| 3586 | retval = rdbLoadRio(&rdb,rdbflags,rsi); |
| 3587 | fclose(fp); |
| 3588 | stopLoading(retval==C_OK); |
| 3589 | return retval; |
| 3590 | } |
| 3591 | |
| 3592 | /* A background saving child (BGSAVE) terminated its work. Handle this. |
| 3593 | * This function covers the case of actual BGSAVEs. */ |
no test coverage detected