Lines Matching refs:root

28 Generic interfaces for manipulating files in an alternate root.  There
30 that path is contained within "root", then those operations will not affect
31 any files living outside of "root". These routines mainly protect us when
73 def ar_open(root, path, flags,
78 'root' is a directory that path must reside in.
80 'path' is a path that is interpreted relative to 'root'. i.e., 'root'
82 would cause an access to be redirected outside of 'root'. If this
93 assert os.path.isabs(root)
104 # we're going to update root and path so prepare an error
106 eremote = _("Path outside alternate root: root={root}, "
107 "path={path}").format(root=root, path=path)
113 # now open the alternate root and get its path
115 root_fd = os.open(root, os.O_RDONLY)
117 root = __fd_to_path(root_fd)
125 # lives in the alternate root
128 path_tmp = os.path.join(root, path)
144 ar_open(root, path_dir, os.O_RDONLY)
162 # verify that the file we opened lives in the alternate root
169 path = os.path.join(root, path)
171 if not path.startswith(root):
185 def ar_unlink(root, path, noent_ok=False):
196 assert os.path.isabs(root)
206 path_dir_fd = ar_open(root, path_dir, os.O_RDONLY)
223 def ar_rename(root, src, dst):
227 'src' and 'dst' are paths that are interpreted relative to 'root'.
228 i.e., 'root' is prepended to both. 'src' and 'dst' can not contain
230 of 'root'. If this happens we'll raise an OSError exception with
237 assert os.path.isabs(root)
250 src_dir_fd = ar_open(root, src_dir, os.O_RDONLY)
252 dst_dir_fd = ar_open(root, dst_dir, os.O_RDONLY)
268 def ar_mkdir(root, path, mode):
276 assert os.path.isabs(root)
285 path_dir_fd = ar_open(root, path_dir, os.O_RDONLY)
295 def ar_stat(root, path):
303 fd = ar_open(root, path, os.O_RDONLY)
310 def ar_isdir(root, path):
318 si = ar_stat(root, path)
328 def ar_exists(root, path):
336 fd = ar_open(root, path, os.O_RDONLY)
344 def ar_diff(root, path1, path2):
355 fd1 = ar_open(root, path1, os.O_RDONLY)
356 fd2 = ar_open(root, path2, os.O_RDONLY)
378 def ar_img_prefix(root):
379 """A function that attempts to determine if a user or root pkg(7)
380 managed image can be found at 'root'. If 'root' does point to a
389 if ar_isdir(root, image.img_user_prefix):
392 if ar_isdir(root, image.img_root_prefix):