Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions fitsio/tests/test_reading_from_memory.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
// `fitsio` does not currently support opening files from memory, `cfitsio` _does_. This means we
// can use `Fitsfile::from_raw` to load a `FitsFile` from a file that was opened via
// `fits_open_memfile` in `cfitsio`.

use fitsio::{errors::check_status, sys, FileOpenMode, FitsFile};
use std::io::Read;

#[test]
fn reading_from_memory() {
// read the bytes into memory and return a pointer and length to the file

let (bytes, mut ptr_size) = {
let filename = "../testdata/full_example.fits";
let mut f = std::fs::File::open(filename).unwrap();
Expand Down