def sys_access(self, buf, mode):
filename = b'<STR_LIT>'<EOL>for i in range(<NUM_LIT:0>, <NUM_LIT:255>):<EOL><INDENT>c = Operators.CHR(self.current.read_int(buf + i, <NUM_LIT:8>))<EOL>if c == b'<STR_LIT:\x00>':<EOL><INDENT>break<EOL><DEDENT>filename += c<EOL><DEDENT>if os.access(filename, mode):<EOL><INDENT>return <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>return -<NUM_LIT:1><EOL><DEDENT>
Checks real user's permissions for a file
:rtype: int

:param buf: a buffer containing the pathname to the file to check its permissions.
:param mode: the access permissions to check.
:return:
    -  C{0} if the calling process can access the file in the desired mode.
    - C{-1} if the calling process can not access the file in the desired mode.