Changeset 34157 in vbox
- Timestamp:
- Nov 18, 2010 9:50:58 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp
r33889 r34157 237 237 { 238 238 { "--input", 'i', RTGETOPT_REQ_STRING }, 239 { "--output", 'o', RTGETOPT_REQ_STRING } 239 { "--output", 'o', RTGETOPT_REQ_STRING }, 240 { "--flags", 'f', RTGETOPT_REQ_STRING } 240 241 }; 241 242 … … 247 248 int rc = VINF_SUCCESS; 248 249 RTFILE hInput = NIL_RTFILE; 250 249 251 RTFILE hOutput = NIL_RTFILE; 252 uint32_t ofFlags = RTFILE_O_CREATE_REPLACE /* Output file flags. */ 253 | RTFILE_O_WRITE 254 | RTFILE_O_DENY_WRITE; 250 255 251 256 while ( (ch = RTGetOpt(&GetState, &ValueUnion)) … … 255 260 switch (ch) 256 261 { 262 case 'f': 263 /* Process flags; no fancy parsing here yet. */ 264 if (RTStrIStr(ValueUnion.psz, "noindex")) 265 ofFlags |= RTFILE_O_NOT_CONTENT_INDEXED; 266 else 267 { 268 VBoxServiceError("cat: Unknown flag set!\n"); 269 rc = VERR_INVALID_PARAMETER; 270 } 271 break; 272 257 273 case 'o': 258 rc = RTFileOpen(&hOutput, ValueUnion.psz, 259 RTFILE_O_CREATE_REPLACE | 260 RTFILE_O_NOT_CONTENT_INDEXED | /* We don't need indexing here. */ 261 RTFILE_O_WRITE | 262 RTFILE_O_DENY_WRITE); 274 rc = RTFileOpen(&hOutput, ValueUnion.psz, ofFlags); 263 275 if (RT_FAILURE(rc)) 264 276 VBoxServiceError("cat: Could not create output file \"%s\"! rc=%Rrc\n",
Note:
See TracChangeset
for help on using the changeset viewer.