demo_creation_time/
demo_creation_time.rs

1use vsf::{VsfBuilder, VsfType};
2
3fn main() {
4    println!("=== VSF Creation Timestamp Demo ===\n");
5
6    // Build a simple VSF file
7    let result = VsfBuilder::new()
8        .add_section(
9            "metadata",
10            vec![
11                ("width".to_string(), VsfType::u(1920, false)),
12                ("height".to_string(), VsfType::u(1080, false)),
13                ("format".to_string(), VsfType::x("RAW".to_string())),
14            ],
15        )
16        .build();
17
18    match result {
19        Ok(bytes) => {
20            println!("✓ Successfully built VSF file: {} bytes\n", bytes.len());
21
22            // Write to file
23            std::fs::write("/tmp/demo.vsf", &bytes).expect("Failed to write file");
24            println!("✓ Written to /tmp/demo.vsf");
25            println!("\nRun: cargo run --bin vsfinfo /tmp/demo.vsf");
26            println!("\nYou should see the creation timestamp in the header!");
27        }
28        Err(e) => {
29            eprintln!("✗ Build error: {}", e);
30            std::process::exit(1);
31        }
32    }
33}