files/
files.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use clipboard_rs::{Clipboard, ClipboardContext, ContentFormat};

fn main() {
	let ctx = ClipboardContext::new().unwrap();

	// change the file paths to your own
	// let files = vec![
	//     "file:///home/parallels/clipboard-rs/Cargo.toml".to_string(),
	//     "file:///home/parallels/clipboard-rs/CHANGELOG.md".to_string(),
	// ];

	// ctx.set_files(files).unwrap();

	let types = ctx.available_formats().unwrap();
	println!("{:?}", types);

	let has = ctx.has(ContentFormat::Files);
	println!("has_files={}", has);

	let files = ctx.get_files().unwrap_or_default();
	println!("{:?}", files);
}