I’m doing a program where I can successfully create a file usign “fat_Open” but when I want to delete it using “fat_Delete” I receive error code “-EPERM” which means “file is read-only, hidden etc. - NOT deleted”. I do not set the file as Read Only when creating it.
When I run “FAT_SHELL.C” program I can successfully delete the file.
In addition, I tried creating a file with “FAT_SHELL.C” program and the deleting it from my own program and it worked.
The only difference I could see is that when I create files from my programs attributes are:
And when I create them from “FAT_SHELL.C” program the attributes are:
I do not know what “A” stands for. On “FAT_SHELL.C” program there is a line saying: " dent.attr & FATATTR_ARCHIVE ? ‘A’ : ‘a’); "
Does anyone know how can I fix this? How to change file attributes? How to create them correctly so I can then delete them afterwards?
Sorry if this turned out to be too long
Thanks for any help you can provide.