Skip to content

Is it a bug or not? SDCard errors treated as NotFound? #246

@yanshay

Description

@yanshay

I'm not sure if it's a bug, looks like it but want to verify that I'm not rushing to conclusions:

let dir_entry = match dir_entry {
Ok(entry) => {
// we are opening an existing file
Some(entry)
}
Err(_)
if (mode == Mode::ReadWriteCreate)
| (mode == Mode::ReadWriteCreateOrTruncate)
| (mode == Mode::ReadWriteCreateOrAppend) =>
{
// We are opening a non-existant file, but that's OK because they
// asked us to create it
None
}
_ => {
// We are opening a non-existant file, and that's not OK.
return Err(Error::NotFound);
}
};

in open_file_in_dir any error, including technical SDCard errors seem to be treated as NotFound rather than separating between NotFound and other errors.

Is that indeed the case or maybe I'm missing something?

I also saw that on other functions but this seems to be with potentially the most severe consequences.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions