Lines Matching refs:fs

9 use std::fs;
11 use std::os::unix::fs::FileTypeExt;
12 use std::os::unix::fs::MetadataExt;
13 use std::os::unix::fs::PermissionsExt;
70 let metadata = fs::symlink_metadata(file_path)?; in from_path()
84 pub fn from_symlink(file_path: &Path, metadata: &fs::Metadata) -> Result<Self> { in from_symlink()
85 let link = fs::read_link(file_path)?; in from_symlink()
101 pub fn from_file(file_path: &Path, metadata: &fs::Metadata, cache: &Cache) -> Result<Self> { in from_file()
231 let file_metadata = fs::symlink_metadata(file_path).expect("no metadata"); in is_special_file()
240 let input = fs::File::open(file_path)?; in compute_digest()
259 metadata: &fs::Metadata, in get_or_compute_digest()
288 pub fn cache_key(&self, file_path: &Path, metadata: &fs::Metadata) -> Result<String> { in cache_key()
302 let mut file = fs::File::open(file_path)?; in read_from_file()
333 let mut file = fs::File::create(file_path)?; in write_to_file()
512 fs::write(&file_path, "").unwrap(); in compute_digest_empty_file()
523 fs::write(&file_path, "This is a test\nof a small file.\n").unwrap(); in compute_digest_small_file()
534 fs::write(&file_path, "This is a test\nof a small file.\n").unwrap(); in get_or_compute_digest_small_file()
536 let metadata = fs::metadata(&file_path).expect("file metadata"); in get_or_compute_digest_small_file()
581 fs::write(&file_path, &boring_buff[0..*num_bytes]).unwrap(); in verify_edge_case_digests()
595 fs::write(&file_path, "This is a test\nof a small file.\n").unwrap(); in fingerprint_file_for_file()
599 let mut perms = fs::metadata(&file_path).expect("Getting permissions").permissions(); in fingerprint_file_for_file()
601 assert!(fs::set_permissions(&file_path, perms).is_ok()); in fingerprint_file_for_file()
621 fs::write(file_path, "This is a test\nof a small file.\n").unwrap(); in fingerprint_file_for_relative_symlink()
662 fs::create_dir(&newdir_path).expect("Should have create 'some_dir' in temp dir"); in fingerprint_file_for_directory()
942 fs::write(file_path, "modified file.").unwrap(); in fingerprint_partition_cache_mismatch_test()
1009 fs::write(file_path.clone(), "invalid cache data").unwrap(); in test_read_cache_file_invalid_file()
1042 fs::create_dir(&partition_dir).expect("should have created directory partition_dir"); in make_partition()
1045 fs::create_dir_all(partition_dir.join(dir)) in make_partition()
1050 fs::create_dir_all(partition_dir.join(file_name).parent().unwrap()).unwrap(); in make_partition()
1051 fs::write(partition_dir.join(file_name), file_content).expect("Trouble writing file"); in make_partition()
1054 fs::create_dir_all(partition_dir.join(symlink_name).parent().unwrap()).unwrap(); in make_partition()
1062 fs::soft_link(target, directory.join(link_name)) in create_symlink()