Lines Matching defs:path
35 use std::path::Path;
88 let mut path = env::temp_dir();
89 path.push("nix_tempfile.XXXXXX");
91 let result = mkstemp(&path);
93 Ok((fd, path)) => {
95 unlink(path.as_path()).unwrap();
111 let mkfifo_fifo = tempdir.path().join("mkfifo_fifo");
139 let mkfifoat_fifo = tempdir.path().join("mkfifoat_fifo");
160 let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap();
198 let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap();
458 let tmpdir_path = tmpdir.path().canonicalize().unwrap();
473 let tmpdir_path = tmpdir.path().canonicalize().unwrap();
477 // make path 500 chars longer so that buffer doubling in getcwd
478 // kicks in. Note: One path cannot be longer than 255 bytes
479 // (NAME_MAX) whole path cannot be longer than PATH_MAX (usually
499 let path = tempdir.path().join("file");
501 File::create(&path).unwrap();
504 chown(&path, uid, gid).unwrap();
505 chown(&path, uid, None).unwrap();
506 chown(&path, None, gid).unwrap();
508 fs::remove_file(&path).unwrap();
509 chown(&path, uid, gid).unwrap_err();
518 let path = tempfile().unwrap();
519 let fd = path.as_raw_fd();
536 let path = tempdir.path().join("file");
538 File::create(&path).unwrap();
541 let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap();
546 chdir(tempdir.path()).unwrap();
549 fs::remove_file(&path).unwrap();
625 let path = file.path().to_str().unwrap();
627 acct::enable(path).unwrap();
631 let len = fs::metadata(path).unwrap().len();
762 let path = tempdir.path().join("file");
765 let mut tmp = File::create(&path).unwrap();
770 truncate(&path, 4).unwrap();
772 let metadata = fs::metadata(&path).unwrap();
779 let path = tempdir.path().join("file");
782 let mut tmp = File::create(&path).unwrap();
791 let metadata = fs::metadata(&path).unwrap();
874 let target = tempdir.path().join("a");
875 let linkpath = tempdir.path().join("b");
882 let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap();
887 readlink(&tempdir.path().join(linkpath))
900 let oldfilepath = tempdir.path().join(oldfilename);
903 let newfilepath = tempdir.path().join(newfilename);
910 fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty())
913 // Attempt hard link file at relative path
932 let oldfilepath = tempdir_oldfile.path().join(oldfilename);
936 let newfilepath = tempdir_newfile.path().join(newfilename);
943 tempdir_newfile.path(),
949 // Attempt hard link file using curent working directory as relative path for old file path
950 chdir(tempdir_oldfile.path()).unwrap();
969 let oldfilepath = tempdir_oldfile.path().join(oldfilename);
973 let newfilepath = tempdir_newfile.path().join(newfilename);
980 tempdir_oldfile.path(),
986 // Attempt hard link file using current working directory as relative path for new file path
987 chdir(tempdir_newfile.path()).unwrap();
1011 let oldfilepath = tempdir.path().join(oldfilename);
1014 let symoldfilepath = tempdir.path().join(symoldfilename);
1017 let newfilepath = tempdir.path().join(newfilename);
1027 fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty())
1030 // Attempt link symlink of file at relative path
1054 let oldfilepath = tempdir.path().join(oldfilename);
1057 let symoldfilepath = tempdir.path().join(symoldfilename);
1060 let newfilepath = tempdir.path().join(newfilename);
1070 fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty())
1073 // Attempt link target of symlink of file at relative path
1101 let dirpath = tempdir.path().join(dirname);
1108 fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty())
1111 // Attempt unlink dir at relative path without proper flag
1122 let dirpath = tempdir.path().join(dirname);
1129 fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty())
1132 // Attempt unlink dir at relative path with proper flag
1142 let filepath = tempdir.path().join(filename);
1149 fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty())
1152 // Attempt unlink file at relative path
1160 let dir = tempdir.path().join("does_not_exist.txt");
1170 let path = tempdir.path().join("does_exist.txt");
1171 let _file = File::create(path.clone()).unwrap();
1172 access(&path, AccessFlags::R_OK | AccessFlags::W_OK)
1317 let dir = tempdir.path().join("does_not_exist.txt");
1331 let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap();
1351 let path = tempdir.path().join("does_exist.txt");
1352 let _file = File::create(path.clone()).unwrap();
1355 &path,
1367 let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap();
1369 let path = tempdir.path().join(exist_file);
1370 let _file = File::create(path.clone()).unwrap();
1373 &path,
1388 let dir = tempdir.path().join("does_not_exist.txt");
1403 let path = tempdir.path().join("does_exist.txt");
1404 let _file = File::create(path.clone()).unwrap();
1405 eaccess(&path, AccessFlags::R_OK | AccessFlags::W_OK)