/ Write on index file, set rc and return the number of bytes written */ /
| 2441 | /* Write on index file, set rc and return the number of bytes written */ |
| 2442 | /***********************************************************************/ |
| 2443 | int XFILE::Write(PGLOBAL g, void *buf, int n, int size, bool& rc) |
| 2444 | { |
| 2445 | int niw = (int)fwrite(buf, size, n, Xfile); |
| 2446 | |
| 2447 | if (niw != n) { |
| 2448 | snprintf(g->Message, sizeof(g->Message), MSG(XFILE_WRITERR), strerror(errno)); |
| 2449 | rc = true; |
| 2450 | } // endif size |
| 2451 | |
| 2452 | return niw * size; |
| 2453 | } // end of Write |
| 2454 | |
| 2455 | /***********************************************************************/ |
| 2456 | /* Update the file header and close the index file. */ |
no test coverage detected