@staticmethod
def parse_unix_mode(s):
    """
        Parsing unix mode strings ("rwxr-x--t") into hexacimal notation.

        :param s: mode string
        :type s: :py:class:`str`

        :return mode:
        :rtype: :py:class:`int`
        """
    parse_rw = {'rw': 6, 'r-': 4, '-w': 2, '--': 0}
    mode = 0
    mode |= parse_rw[s[0:2]] << 6
    mode |= parse_rw[s[3:5]] << 3
    mode |= parse_rw[s[6:8]]
    if s[2] == 's':
        mode |= 2112
    elif s[2] == 'x':
        mode |= 64
    elif s[2] != '-':
        raise ValueError
    if s[5] == 's':
        mode |= 1032
    elif s[5] == 'x':
        mode |= 8
    elif s[5] != '-':
        raise ValueError
    if s[8] == 't':
        mode |= 512
    elif s[8] == 'x':
        mode |= 1
    elif s[8] != '-':
        raise ValueError
    return mode
