espressif / arduino-esp32

Arduino core for the ESP32
GNU Lesser General Public License v2.1
13.62k stars 7.41k forks source link

SD.remove() fails on file name that has no extension, confuses it for a directory name #9465

Open frankcohen opened 7 months ago

frankcohen commented 7 months ago

Board

ESP32-S3 Dev Module

Device Description

Reflections open-source project uses ESP32-S3 Mini 1 with a Nand (an SD in SMT format) XTSD01GLGEAG chip. Schematic and Gerber files at https://github.com/frankcohen/ReflectionsOS/tree/main/Devices/Yertle

Hardware Configuration

// SPI Bus

define SPI_MOSI 35

define SPI_MISO 37

define SPI_SCK 36

define SPI_SPEED 10000000

// NAND Storage

define NAND_SPI_CS 15

Version

latest master (checkout manually)

IDE Name

Arduino IDE 2.3.2

Operating System

MacOS Sonoma 14.4.1

Flash frequency

80 Mhz

PSRAM enabled

yes

Upload speed

115200

Description

Remove file named /REFLECTIONS/log1 and get an error: File or Directory does not exist. It appears to confuse log1 for a directory. Remove file named /REFLECTIONS/log1.txt and it removes the file successfully.

Sketch

void deleteFile(fs::FS &fs, const char * path){
    Serial.printf("Deleting file: %s\n", path);
    if(fs.remove(path)){
        Serial.println("File deleted");
    } else {
        Serial.println("Delete failed");
    }
}

Debug Message

No debug info given when it fails.

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

lbernstone commented 7 months ago

Please provide code. Unable to reproduce https://wokwi.com/projects/394638383953711105

frankcohen commented 7 months ago

The whole of the code is at https://github.com/frankcohen/ReflectionsOS/tree/main/src The delete isn't working in logger.cpp. That's too much to send. I'm going to write a smaller sketch showing the problem. Will post tomorrow. -Frank

P-R-O-C-H-Y commented 4 months ago

Hi @frankcohen, is this issue still valid? If yes, can you please provide as you mentioned a small reproducible sketch? Thanks

frankcohen commented 4 months ago

Working on a write up of this and other issues found. Need another few days. -Frank

On Jun 21, 2024, at 11:29 AM, Jan Procházka @.***> wrote:

Hi @frankcohen https://github.com/frankcohen, is this issue still valid? If yes, can you please provide as you mentioned a small reproducible sketch? Thanks

— Reply to this email directly, view it on GitHub https://github.com/espressif/arduino-esp32/issues/9465#issuecomment-2183256383, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUEWML4K2YH32DZOWYCVDLZIRWJRAVCNFSM6AAAAABF5OWGISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBTGI2TMMZYGM. You are receiving this because you were mentioned.