Skip to content

Explanation about openNext vs open functions #508

Open
@SherifMEldeeb

Description

@SherifMEldeeb

Issue Description:

I am reading a hidden directory content that was created earlier how ever for some reason that directory sometimes gets empty files with 0bytes size and weird names like

Reading directory test
         0 2025-01-21 17:11 ?
         0 2025-01-21 17:11 ??
         0 2025-01-21 17:11 ?(???
         0 2025-01-21 17:11 ?
         0 2025-01-21 17:11 ??
         0 2025-01-21 17:11 ?@??
         0 2025-01-21 17:11 %?
         0 2025-01-21 17:11 %?
         0 2025-01-21 17:11 `???
         0 2025-01-21 17:11 ?
         0 2025-01-21 17:11 ?
         0 2025-01-21 17:11 ??
         0 2025-01-21 17:11 ???
         0 2025-01-21 17:11 ???
         0 2025-01-21 17:11 ???
         0 2025-01-21 17:11 ??
         0 2025-01-21 17:11 ??!??
         0 2025-01-21 17:11 ???!
         0 2025-01-21 17:11 ???!?
         0 2025-01-21 17:11 ??!
         0 2025-01-21 17:11 ???!?
         0 2025-01-21 17:11 ??
         0 2025-01-21 17:11 ???
         0 2025-01-21 17:11 ??.??
         0 2025-01-21 17:11 ?(?
         0 2025-01-21 17:11 ?@?!
         0 2025-01-21 17:11 a???
         0 2025-01-21 17:11 ?
         0 2025-01-21 17:11 ????
         0 2025-01-21 17:11 ?
         0 2025-01-21 17:11 ?
         0 2025-01-21 17:11 ?
         0 2025-01-21 17:11 ??
         0 2025-01-21 17:11 ???
         0 2025-01-21 17:11 ???
         0 2025-01-21 17:11 ??
         0 2025-01-21 17:11 ??
         0 2025-01-21 17:11 ??
         0 2025-01-21 17:11 ?
         0 2025-01-21 17:11 ??!??
         0 2025-01-21 17:11 ???
         0 2025-01-21 17:11 ?.?
         0 2025-01-21 17:11 ?.B
         0 2025-01-21 17:11 ????@?
         0 2025-01-21 17:11 ??@
         0 2025-01-21 17:11 ?@??
         0 2025-01-21 17:11 ?@
         0 2025-01-21 17:11 ?@?
         0 2025-01-21 17:11 ?@??
         0 2025-01-21 17:11 ?$
         0 2025-01-21 17:11 ?$?
         0 2025-01-21 17:11 ??3
         0 2025-01-21 17:11 ?B??
         0 2025-01-21 17:11 ?D?
         0 2025-01-21 17:11 D?
         0 2025-01-21 17:11 e?
         0 2025-01-21 17:11 e?
         0 2025-01-21 17:11 e??
         0 2025-01-21 17:11 e?
         0 2025-01-21 17:11 e?AB
         0 2025-01-21 17:11 e???@
         0 2025-01-21 17:11 e?B
         0 2025-01-21 17:11 g???
         0 2025-01-21 17:11 m?
         0 2025-01-21 17:11 t?
         0 2025-01-21 17:11 u?
         0 2025-01-21 17:11 ?
         0 2025-01-21 17:11 ??
         0 2025-01-21 17:11 ?b@??

As I understood while. debugging this issue that openNext and printfile names gets their files from cached entries or something like that how ever all CRUD operations like remove, read, write, exists use open method which I suppose it uses the actual card content so the problem is these are useless files for me so I want to delete them when ever they are found but all CRUD operations failes on these files except for reading their name I am not sure how to fix this or how to debug it.

Current Behavior:

Can't remove or open 0 bytes files exist in a directory.

Expected Behavior:

If reading directory contents returns x number of files I should be able to interact with all these files.

Setup:

Controller: Esp32s3
Library Version: 2.1.2

Card Info:

init time: 5 ms
SdFat version: 20102

Card type: SDHC

Manufacturer ID: 0X0
OEM ID: 
Product: 
Version: 0.0
Serial number: 0X996B0000
Manufacturing date: 10/2016

cardSize: 4026.53 MB (MB = 1,000,000 bytes)
flashEraseSize: 128 blocks
eraseSingleBlock: true
OCR: 0XC0FF8000

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions