- Timestamp:
- Feb 25, 2016 8:59:17 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/zip/tarcmd.cpp
r57358 r59826 61 61 #define RTZIPTARCMD_OPT_DIR_MODE_OR_MASK 1008 62 62 #define RTZIPTARCMD_OPT_FORMAT 1009 63 #define RTZIPTARCMD_OPT_READ_AHEAD 1010 63 64 64 65 /** File format. */ … … 104 105 * traditional TAR format). */ 105 106 bool fNoModTime; 107 /** Whether to add a read ahead thread. */ 108 bool fReadAhead; 106 109 /** The compressor/decompressor method to employ (0, z or j). */ 107 110 char chZipper; … … 494 497 { 495 498 /* 499 * Convert source to a stream and optionally add a read ahead stage. 500 */ 501 RTVFSIOSTREAM hVfsIosSrc = RTVfsObjToIoStream(hVfsObj); 502 if (pOpts->fReadAhead) 503 { 504 RTVFSIOSTREAM hVfsReadAhead; 505 rc = RTVfsCreateReadAheadForIoStream(hVfsIosSrc, 0 /*fFlag*/, 16 /*cBuffers*/, _256K /*cbBuffer*/, &hVfsReadAhead); 506 if (RT_SUCCESS(rc)) 507 { 508 RTVfsIoStrmRelease(hVfsIosSrc); 509 hVfsIosSrc = hVfsReadAhead; 510 } 511 else 512 AssertRC(rc); /* can be ignored in release builds. */ 513 } 514 515 /* 496 516 * Pump the data thru. 497 517 */ 498 RTVFSIOSTREAM hVfsIosSrc = RTVfsObjToIoStream(hVfsObj);499 518 rc = RTVfsUtilPumpIoStreams(hVfsIosSrc, hVfsIosDst, (uint32_t)RT_MIN(pUnixInfo->cbObject, _1M)); 500 519 if (RT_SUCCESS(rc)) … … 641 660 642 661 /* 643 * Set other attributes as requested 644 * .662 * Set other attributes as requested. 663 * 645 664 * Note! File extraction does get here. 646 665 */ … … 931 950 " --dir-mode-and-mask <octal-mode> (-A, -C, -d, -r, -u, -x)\n" 932 951 " Include the given access mode for directories.\n" 952 " --read-ahead (-x)\n" 953 " Enabled read ahead thread when extracting files.\n" 933 954 "\n"); 934 955 RTPrintf("Standard Options:\n" … … 986 1007 { "--dir-mode-or-mask", RTZIPTARCMD_OPT_DIR_MODE_OR_MASK, RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_OCT }, 987 1008 { "--format", RTZIPTARCMD_OPT_FORMAT, RTGETOPT_REQ_STRING }, 1009 { "--read-ahead", RTZIPTARCMD_OPT_READ_AHEAD, RTGETOPT_REQ_NOTHING }, 988 1010 }; 989 1011 … … 1134 1156 break; 1135 1157 1158 case RTZIPTARCMD_OPT_READ_AHEAD: 1159 Opts.fReadAhead = true; 1160 break; 1161 1136 1162 /* Standard bits. */ 1137 1163 case 'h':
Note:
See TracChangeset
for help on using the changeset viewer.