VirtualBox

Ignore:
Timestamp:
Jan 18, 2008 9:15:20 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
27330
Message:

next try

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp

    r6382 r6384  
    592592        RTPrintf("VBoxManage sharedfolder     add <vmname>|<uuid>\n"
    593593                 "                            -name <name> -hostpath <hostpath>\n"
    594                  "                            [-transient]\n"
     594                 "                            [-transient] [-readonly]\n"
    595595                 "\n");
    596596    }
     
    19071907            CHECK_ERROR_RET(sfEnum, GetNext(sf.asOutParam()), rc);
    19081908            Bstr name, hostPath;
     1909            BOOL writable;
    19091910            sf->COMGETTER(Name)(name.asOutParam());
    19101911            sf->COMGETTER(HostPath)(hostPath.asOutParam());
     1912            sf->COMGETTER(Writable)(&writable);
    19111913            if (!numSharedFolders && details != VMINFO_MACHINEREADABLE)
    19121914                RTPrintf("\n\n");
     
    19191921            }
    19201922            else
    1921                 RTPrintf("Name: '%lS', Host path: '%lS' (machine mapping)\n", name.raw(), hostPath.raw());
     1923                RTPrintf("Name: '%lS', Host path: '%lS' (machine mapping), %s\n",
     1924                         name.raw(), hostPath.raw(), writable ? "writable" : "readonly");
    19221925            ++numSharedFolders;
    19231926            CHECK_ERROR_RET(sfEnum, HasMore(&fMore), rc);
     
    70227025        char *hostpath = NULL;
    70237026        bool fTransient = false;
     7027        bool fWritable = true;
    70247028
    70257029        for (int i = 2; i < argc; i++)
     
    70427046                i++;
    70437047                hostpath = argv[i];
    7044 
     7048            }
     7049            else if (strcmp(argv[i], "-readonly") == 0)
     7050            {
     7051                fWritable = false;
    70457052            }
    70467053            else if (strcmp(argv[i], "-transient") == 0)
     
    70717078            CHECK_ERROR_RET(aSession, COMGETTER(Console)(console.asOutParam()), 1);
    70727079
    7073             CHECK_ERROR(console, CreateSharedFolder(Bstr(name), Bstr(hostpath)));
     7080            CHECK_ERROR(console, CreateSharedFolder(Bstr(name), Bstr(hostpath), fWritable));
    70747081
    70757082            if (console)
     
    70847091            aSession->COMGETTER(Machine)(machine.asOutParam());
    70857092
    7086             CHECK_ERROR(machine, CreateSharedFolder(Bstr(name), Bstr(hostpath)));
     7093            CHECK_ERROR(machine, CreateSharedFolder(Bstr(name), Bstr(hostpath), fWritable));
    70877094
    70887095            if (SUCCEEDED(rc))
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