MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / create_test_file

Function create_test_file

nodedb/src/data/io/uring_reader.rs:315–322  ·  view source on GitHub ↗
(dir: &Path, name: &str, size: usize)

Source from the content-addressed store, hash-verified

313 use std::io::Write;
314
315 fn create_test_file(dir: &Path, name: &str, size: usize) -> std::path::PathBuf {
316 let path = dir.join(name);
317 let mut f = std::fs::File::create(&path).unwrap();
318 let data: Vec<u8> = (0..size).map(|i| (i % 256) as u8).collect();
319 f.write_all(&data).unwrap();
320 f.sync_all().unwrap();
321 path
322 }
323
324 #[test]
325 fn read_single_file() {

Callers 5

read_single_fileFunction · 0.85
read_oversized_fileFunction · 0.85
pool_buffers_are_reusedFunction · 0.85

Calls 3

joinMethod · 0.80
collectMethod · 0.80
createFunction · 0.50

Tested by 5

read_single_fileFunction · 0.68
read_oversized_fileFunction · 0.68
pool_buffers_are_reusedFunction · 0.68