<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def findrootname(filename):
 """ Return the rootname of the given file. """


    puncloc = [filename.find(char) for char in string.punctuation]
    if sys.version_info[0] >= 3:
        val = sys.maxsize
    else:
        val = sys.maxint
    for num in puncloc:
        if num !=-1 and num < val:
            val = num
    return filename[0:val]