POSIX functions with spiffs works wrong? ("access" doest work)

newsettler_AI
Posts: 114
Joined: Wed Apr 05, 2017 12:49 pm

POSIX functions with spiffs works wrong? ("access" doest work)

Postby newsettler_AI » Thu Mar 07, 2019 3:38 pm

Hi, I'm using spiffs and I have created binary file.

I need check file existance.

When I'm cheking with

Code: Select all

fopen(path, "rb") != NULL
{
   // file exist
}
it works. But it takes about 300-400 ms to do this check for some reason :?

So I want to try different - access function.

Code: Select all


if ( access(path, (F_OK) != -1 )
{
	// file exist
}
else
{
        // no file
}
This always give me that file doesnt exist. Also I tried add check with (F_OK | X_OK) params, but same.

Any ideas why it happens?

P.S. File size is not big - about 4-8 bytes.

Who is online

Users browsing this forum: No registered users and 14 guests