Changeset 69718 in vbox for trunk/src/VBox/Runtime/tools
- Timestamp:
- Nov 16, 2017 2:55:45 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 119099
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/tools/RTMkDir.cpp
r69716 r69718 52 52 /** Whether to always use the VFS chain API (for testing). */ 53 53 bool fAlwaysUseChainApi; 54 /** Directory creation flags (RTDIRCREATE_FLAGS_XXX). */ 55 uint32_t fCreateFlags; 54 56 /** The directory mode. */ 55 57 RTFMODE fMode; 56 /** The mode to apply to parent directories we create. */57 RTFMODE fParentMode;58 58 } RTCMDMKDIROPTS; 59 59 … … 174 174 175 175 /* Not found, so try create it. */ 176 rc = RTVfsDirCreateDir(hVfsCurDir, pszFinalPath, ch == '\0' ? pOpts->fMode : pOpts->fParentMode, 177 0 /*fFlags*/, &hVfsNextDir); 176 rc = RTVfsDirCreateDir(hVfsCurDir, pszFinalPath, pOpts->fMode, pOpts->fCreateFlags, &hVfsNextDir); 178 177 if (rc == VERR_ALREADY_EXISTS) 179 178 continue; /* We lost a creation race, try again. */ … … 257 256 { "--parents", 'p', RTGETOPT_REQ_NOTHING }, 258 257 { "--always-use-vfs-chain-api", 'A', RTGETOPT_REQ_NOTHING }, 258 { "--allow-content-indexing", 'i', RTGETOPT_REQ_NOTHING }, 259 259 { "--verbose", 'v', RTGETOPT_REQ_NOTHING }, 260 260 }; … … 267 267 268 268 RTCMDMKDIROPTS Opts; 269 Opts.fVerbose = false;270 Opts.fParents = false;271 Opts.fAlwaysUseChainApi = false;272 Opts.f Mode = 0775 | RTFS_TYPE_DIRECTORY | RTFS_DOS_DIRECTORY;273 Opts.f ParentMode= 0775 | RTFS_TYPE_DIRECTORY | RTFS_DOS_DIRECTORY;269 Opts.fVerbose = false; 270 Opts.fParents = false; 271 Opts.fAlwaysUseChainApi = false; 272 Opts.fCreateFlags = RTDIRCREATE_FLAGS_NOT_CONTENT_INDEXED_NOT_CRITICAL | RTDIRCREATE_FLAGS_NOT_CONTENT_INDEXED_SET; 273 Opts.fMode = 0775 | RTFS_TYPE_DIRECTORY | RTFS_DOS_DIRECTORY; 274 274 275 275 RTGETOPTUNION ValueUnion; … … 281 281 case 'm': 282 282 /** @todo DOS+NT attributes and symbolic notation. */ 283 Opts.fMode &= ~07777; 284 Opts.fMode |= ValueUnion.u32 & 07777; 285 Opts.fParentMode &= ~07777; 286 Opts.fParentMode |= ValueUnion.u32 & 07777; 283 Opts.fMode &= ~07777; 284 Opts.fMode |= ValueUnion.u32 & 07777; 287 285 break; 288 286 … … 298 296 Opts.fAlwaysUseChainApi = true; 299 297 break; 298 299 case 'i': 300 Opts.fCreateFlags &= ~RTDIRCREATE_FLAGS_NOT_CONTENT_INDEXED_SET; 301 Opts.fCreateFlags |= RTDIRCREATE_FLAGS_NOT_CONTENT_INDEXED_DONT_SET; 302 break; 303 300 304 case 'h': 301 RTPrintf("Usage: %s [-pv] [-m|--mode <mode>] <dir> [..]\n", papszArgs[0]); 305 RTPrintf("Usage: %s [options] <dir> [..]\n" 306 "\n" 307 "Options:\n" 308 " -m <mode>, --mode <mode>\n" 309 " The creation mode. Default is 0775.\n" 310 " -p, --parent\n" 311 " Create parent directories too. Ignore any existing directories.\n" 312 " -v, --verbose\n" 313 " Tell which directories get created.\n" 314 " -A, --always-use-vfs-chain-api\n" 315 " Always use the VFS API.\n" 316 " -i, --allow-content-indexing\n" 317 " Don't set flags to disable context indexing on windows.\n" 318 , papszArgs[0]); 302 319 return RTEXITCODE_SUCCESS; 303 320
Note:
See TracChangeset
for help on using the changeset viewer.