Otherwise you can use this small bit :

def copyWrapper(sourcePath, targetPath, move = False):
    if move == True:
        try:
            shutil.move(sourcePath, targetPath)
        except:
            pass
    else:
        infile = open(sourcePath, "rb")
        outfile = open(targetPath, "wb")
        try:
            outfile.write(infile.read())
        except:
            pass
        infile.close()
        outfile.close()

One of the drawbacks with shutil is that it reads files in very small chunks, which not only makes it slow on Windows, but will also potentially fragment files.

Best Regards
Jimmy Christensen
Developer
Ghost A/S

On 15/06/12 10:13, Ron Ganbar wrote:
Did you start with:
import shutil

?

R

On Jun 15, 2012 1:06 AM, "theta" <[email protected]
<mailto:[email protected]>> wrote:

    __
    I'm getting an error that says "name 'shutil' is not defined. Why is
    this?

    _______________________________________________
    Nuke-users mailing list
    [email protected]
    <mailto:[email protected]>,
    http://forums.thefoundry.co.uk/
    http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users



_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Reply via email to