VirtualBox

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


Ignore:
Timestamp:
May 21, 2018 12:51:27 PM (7 years ago)
Author:
vboxsync
Message:

IPRT: Tweaked ntfsvfs.cpp and RTCp.cpp so it's patch files, provided the size doesn't change and they're large enough to not live in the MFT. This is very crude, but it's enormously helpful for tweaking the kernel.

File:
1 edited

Legend:

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

    r70442 r72273  
    6161    /** -x, --one-filesystem. */
    6262    bool            fOneFileSystem;
     63
     64    /** Special --no-replace-nor-trucate hack for basic NTFS write support. */
     65    bool            fNoReplaceNorTruncate;
    6366
    6467    /** Number of sources. */
     
    143146                {
    144147                    RTVFSFILE hVfsDst;
    145                     rc = RTVfsChainOpenFile(pszDst, RTFILE_O_READWRITE | RTFILE_O_CREATE_REPLACE | RTFILE_O_DENY_WRITE,
    146                                             &hVfsDst, &offError, RTErrInfoInitStatic(&ErrInfo));
     148                    uint64_t fDstFlags = (pOpts->fNoReplaceNorTruncate ? RTFILE_O_OPEN_CREATE : RTFILE_O_CREATE_REPLACE)
     149                                       | RTFILE_O_READWRITE | RTFILE_O_DENY_WRITE | (0666 << RTFILE_O_CREATE_MODE_SHIFT);
     150                    rc = RTVfsChainOpenFile(pszDst, fDstFlags, &hVfsDst, &offError, RTErrInfoInitStatic(&ErrInfo));
    147151                    if (RT_SUCCESS(rc))
    148152                    {
     
    240244        { "--verbose",                          'v', RTGETOPT_REQ_NOTHING },
    241245        { "--one-file-system",                  'x', RTGETOPT_REQ_NOTHING },
     246        { "--no-replace-nor-trucate",          1032, RTGETOPT_REQ_NOTHING },
    242247    };
    243248
     
    247252    Opts.fRecursive                 = false;
    248253    Opts.fOneFileSystem             = false;
     254    Opts.fNoReplaceNorTruncate      = false;
    249255    Opts.pszDestination             = NULL;
    250256    Opts.cSources                   = 0;
     
    303309                    break;
    304310
     311                case 1032:
     312                    Opts.fNoReplaceNorTruncate = true;
     313                    break;
     314
    305315                case 'h':
    306316                    RTPrintf("Usage: to be written\nOption dump:\n");
Note: See TracChangeset for help on using the changeset viewer.

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