def bind_at(self, flags_arg, args): flags = handle_flags(flags_arg) dest_filename = get_arg(args, '-t') src_filename = get_arg(args, '-t') obj = ns.resolve_obj(self.caller_root, src_filename, cwd=self.cwd, nofollow=(flags['build_fs'] & ns.FS_FOLLOW_SYMLINKS) != 0) if not ((flags['build_fs'] & ns.FS_OBJECT_RW != 0) or (flags['build_fs'] & ns.FS_SLOT_RWC != 0)): obj = ns.make_read_only_proxy(obj) self.proc.get_namespace().attach_at_path(dest_filename, obj) self.namespace_empty = False if flags['a']: self.proc.args.append(dest_filename)
def _resolve_obj(self, pathname): if self.cwd_path is None: return ns.resolve_obj(self.root_dir, pathname) else: return ns.resolve_obj(self.root_dir, os.path.join(self.cwd_path, pathname))
def get_obj(self, pathname): return ns.resolve_obj(self._root, pathname, cwd=self._cwd, nofollow=False)