Skip to content

LittleFS.exists() is giving an error #7615

Closed
@Adrianotiger

Description

@Adrianotiger

Board

ESP32-S3

Device Description

ESP32-S3 16MB Dev-Kit

Hardware Configuration

Nothing

Version

v2.0.5

IDE Name

Arduino IDE 2.0.4

Operating System

Windows 10

Flash frequency

240MHz

PSRAM enabled

no

Upload speed

115200

Description

I am using the LittleFS library.
When I try to check if a file exists, this function is executed:

bool LittleFSImpl::exists(const char* path)

bool LittleFSImpl::exists(const char* path)
{
    File f = open(path, "r",false);
    return (f == true);
}

As it try to open a file, I get this error:
[E][vfs_api.cpp:104] open(): /littlefs/g00000/c001 does not exist, no permits for creation

From this line:

log_e("%s does not exist, no permits for creation", temp);

I think this error should not be logged, if we just check if a file exists.

Sketch

char path[20];
createPath(path);  
if(!LittleFS.exists(path))
{
  LittleFS.mkdir(path);
}

Debug Message

[E][vfs_api.cpp:104] open(): /littlefs/g00000/c001 does not exist, no permits for creation

Other Steps to Reproduce

No response

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

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions