@_pathdec<EOL><INDENT>def open(self, tid, flags):<DEDENT>
pt = self.PathType.get(tid)<EOL>if pt is not self.PathType.file and pt is not self.PathType.ctrl:<EOL><INDENT>raise FuseOSError(errno.EINVAL)<EOL><DEDENT>if pt is not self.PathType.ctrl and (flags & os.O_WRONLY or flags & os.O_RDWR):<EOL><INDENT>raise FuseOSError(errno.EPERM)<EOL><DEDENT>if not self.__exists(tid):<EOL><INDENT>raise FuseOSError(errno.ENOENT)<EOL><DEDENT>try:<EOL><INDENT>yts = self.searches[tid[<NUM_LIT:0>]][tid[<NUM_LIT:1>]]<EOL><DEDENT>except KeyError:<EOL><INDENT>return self.fds.push(None) <EOL><DEDENT>try:<EOL><INDENT>obI = yts.obtainInfo() <EOL><DEDENT>except ConnectionError:<EOL><INDENT>raise FuseOSError(errno.ENETDOWN)<EOL><DEDENT>if obI:<EOL><INDENT>fh = self.fds.push(yts)<EOL>try:<EOL><INDENT>yts.registerHandler(fh)<EOL><DEDENT>except ConnectionError:<EOL><INDENT>raise FuseOSError(errno.ENETDOWN)<EOL><DEDENT>return fh<EOL><DEDENT>else:<EOL><INDENT>raise FuseOSError(errno.EINVAL)<EOL><DEDENT>
File open. ``YTStor`` object associated with this file is initialised and written to ``self.fds``.

Parameters
----------
tid : str
    Path to file. Original `path` argument is converted to tuple identifier by ``_pathdec`` decorator.
flags : int
    File open mode. Read-only access is allowed.

Returns
-------
int
    New file descriptor