VirtualBox

Changeset 69718 in vbox for trunk/src/VBox/Runtime/tools


Ignore:
Timestamp:
Nov 16, 2017 2:55:45 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
119099
Message:

RTMkDir,nt/RTDirRelDirCreate: Some adjustments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/tools/RTMkDir.cpp

    r69716 r69718  
    5252    /** Whether to always use the VFS chain API (for testing). */
    5353    bool        fAlwaysUseChainApi;
     54    /** Directory creation flags (RTDIRCREATE_FLAGS_XXX).   */
     55    uint32_t    fCreateFlags;
    5456    /** The directory mode. */
    5557    RTFMODE     fMode;
    56     /** The mode to apply to parent directories we create. */
    57     RTFMODE     fParentMode;
    5858} RTCMDMKDIROPTS;
    5959
     
    174174
    175175                    /* 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);
    178177                    if (rc == VERR_ALREADY_EXISTS)
    179178                        continue; /* We lost a creation race, try again. */
     
    257256        { "--parents",                  'p', RTGETOPT_REQ_NOTHING },
    258257        { "--always-use-vfs-chain-api", 'A', RTGETOPT_REQ_NOTHING },
     258        { "--allow-content-indexing",   'i', RTGETOPT_REQ_NOTHING },
    259259        { "--verbose",                  'v', RTGETOPT_REQ_NOTHING },
    260260    };
     
    267267
    268268    RTCMDMKDIROPTS Opts;
    269     Opts.fVerbose           = false;
    270     Opts.fParents           = false;
    271     Opts.fAlwaysUseChainApi = false;
    272     Opts.fMode              = 0775 | RTFS_TYPE_DIRECTORY | RTFS_DOS_DIRECTORY;
    273     Opts.fParentMode        = 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;
    274274
    275275    RTGETOPTUNION ValueUnion;
     
    281281            case 'm':
    282282                /** @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;
    287285                break;
    288286
     
    298296                Opts.fAlwaysUseChainApi = true;
    299297                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
    300304            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]);
    302319                return RTEXITCODE_SUCCESS;
    303320
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette