georust / georust/gdal

Error printed to stderr when calling `get_vsi_mem_file_bytes_owned`

Open
#331 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
450
Forks
111
PR merge metrics
No merged PRs in 30d

Description

Whenever I call `get_vsi_mem_file_bytes_owned` the operation appears to succeed with no error, however the following is always written to stderr:

```
ERROR 6: Cannot extended in-memory file whose ownership was not transferred
```

I worked around this by doing the following, which has the same effect as `get_vsi_mem_file_bytes_owned`, but doesn't produce the error message:

```rust
let mut owned_bytes = vec![];
gdal::vsi::call_on_mem_file_bytes(
"/vsimem/some_path,
|bytes| {
owned_bytes.extend_from_slice(bytes);
},
)?;
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the implementation of `get_vsi_mem_file_bytes_owned` and compare it with the reported `call_on_mem_file_bytes` workaround. Reproduce the call and verify that the owned-byte result remains correct without writing the ownership error to stderr.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.