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. */
| 2752 | * If you pass an 'rsi' structure initialied with RDB_SAVE_OPTION_INIT, the |
| 2753 | * loading code will fiil the information fields in the structure. */ |
| 2754 | int rdbLoad(char *filename, rdbSaveInfo *rsi, int rdbflags) { |
| 2755 | FILE *fp; |
| 2756 | rio rdb; |
| 2757 | int retval; |
| 2758 | |
| 2759 | if ((fp = fopen(filename,"r")) == NULL) return C_ERR; |
| 2760 | startLoadingFile(fp, filename,rdbflags); |
| 2761 | rioInitWithFile(&rdb,fp); |
| 2762 | retval = rdbLoadRio(&rdb,rdbflags,rsi); |
| 2763 | fclose(fp); |
| 2764 | stopLoading(retval==C_OK); |
| 2765 | return retval; |
| 2766 | } |
| 2767 | |
| 2768 | /* A background saving child (BGSAVE) terminated its work. Handle this. |
| 2769 | * This function covers the case of actual BGSAVEs. */ |
no test coverage detected