<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def openMaskFile(filename):
 """ Open the bitmask file sitting next to a file in the filesystem. """

    dirname, basename = os.path.split(filename)
    newbasename = '_%s_.sbm' % (basename,)
    maskfname = os.path.join(dirname, newbasename)
    maskfile = openReadWrite(maskfname)
    return maskfile