import os
import nuke
import nukescripts

def createOutDir ( file ):
    myDir = os.path.dirname( file )
    if not os.path.isdir( osdir ): 
        if nuke.ask( 'Create directory?\n%s' % myDir ):
            return os.makedirs( myDir )
        else:   raise Exception

