VirtualBox

Changeset 35260 in vbox for trunk/src


Ignore:
Timestamp:
Dec 20, 2010 5:31:46 PM (14 years ago)
Author:
vboxsync
Message:

VBoxShell: gcopy command

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxShell/vboxshell.py

    r34393 r35260  
    10951095        reportError(ctx, progress)
    10961096
     1097def copyToGuest(ctx,console,args,user,passwd):
     1098    src = args[0]
     1099    dst = args[1]
     1100    flags = 0
     1101    print "Copying host %s to guest %s" %(src,dst)
     1102    progress = console.guest.copyToGuest(src, dst, user, passwd, flags)
     1103    progressBar(ctx, progress)
     1104
    10971105def nh_raw_input(prompt=""):
    10981106    stream = sys.stdout
     
    11291137    (user,passwd) = getCred(ctx)
    11301138    gargs.insert(0, lambda ctx,mach,console,args: execInGuest(ctx,console,args,env,user,passwd,10000))
     1139    cmdExistingVm(ctx, mach, 'guestlambda', gargs)
     1140    return 0
     1141
     1142def gcopyCmd(ctx,args):
     1143    if (len(args) < 2):
     1144        print "usage: gcopy [vmname|uuid] host_path guest_path"
     1145        return 0
     1146    mach = argsToMach(ctx,args)
     1147    if mach == None:
     1148        return 0
     1149    gargs = args[2:]
     1150    (user,passwd) = getCred(ctx)
     1151    gargs.insert(0, lambda ctx,mach,console,args: copyToGuest(ctx,console,args,user,passwd))
    11311152    cmdExistingVm(ctx, mach, 'guestlambda', gargs)
    11321153    return 0
     
    30403061            'ginfo':['Shows info on guest', ginfoCmd, 0],
    30413062            'gexec':['Executes program in the guest', gexecCmd, 0],
     3063            'gcopy':['Copy file to the guest', gcopyCmd, 0],
    30423064            'alias':['Control aliases', aliasCmd, 0],
    30433065            'verbose':['Toggle verbosity', verboseCmd, 0],
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