(err)
| 2324 | dst.write(dstHandle, readbuf, datapos, nb, dstpos, writeCb); |
| 2325 | |
| 2326 | function writeCb(err) { |
| 2327 | if (err) |
| 2328 | return onerror(err); |
| 2329 | |
| 2330 | total += nb; |
| 2331 | onstep && onstep(total, nb, fsize); |
| 2332 | |
| 2333 | if (nb < origChunkLen) |
| 2334 | return singleRead(datapos, dstpos + nb, origChunkLen - nb); |
| 2335 | |
| 2336 | if (total === fsize) { |
| 2337 | dst.close(dstHandle, (err) => { |
| 2338 | dstHandle = undefined; |
| 2339 | if (err) |
| 2340 | return onerror(err); |
| 2341 | src.close(srcHandle, (err) => { |
| 2342 | srcHandle = undefined; |
| 2343 | if (err) |
| 2344 | return onerror(err); |
| 2345 | cb(); |
| 2346 | }); |
| 2347 | }); |
| 2348 | return; |
| 2349 | } |
| 2350 | |
| 2351 | if (pdst >= fsize) |
| 2352 | return; |
| 2353 | |
| 2354 | const chunk = |
| 2355 | (pdst + chunkSize > fsize ? fsize - pdst : chunkSize); |
| 2356 | singleRead(datapos, pdst, chunk); |
| 2357 | pdst += chunk; |
| 2358 | } |
| 2359 | } |
| 2360 | |
| 2361 | function makeCb(psrc, pdst, chunk) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…