heinbali01 wrote on Friday, November 17, 2017:
Hi Sergey,
when i trying to create directory with name same as disk mount point
it will successfully create directory with empty name on the disk :
Yes, we were aware of this. After creation there will be a physical directory “/usb
”, and a logical (mounted) directory with the same name.
I mounted usb flash drive to point “/usb”. Mount was successful,
i can see files and folders on the drive.
Indeed, when you access /usb
, the logical ( mounted ) directory will prevail.
Then for test purposes i call ff_mkdir(“/usb”) awaiting that it return
me some error, for example FF_ERR_DIR_OBJECT_EXISTS
, but it was successful !
You’re right, formally this should be checked for.
Looking in flash disk drive i see new directory whith empty name that
can not be entered or deleted.
There is indeed a bit of a problem here, also FTP shows two directories: a virtual one, and a physical directory on an SD-card.
Only formatting whole drive helps remove it ))
Not true. When using the FF_
functions, the directory can be emptied and removed.
As you have probably seen, the ff_
functions from ff_stdio.c
are aware of the mounted directories.
FF_
functions have an I/O manager as a parameter, and these functions are working on physical drives only.
Is it normal ?
We always seek a balance between simplicity and completeness, correctness.
I was aware that a physical directory can be created, while a mounted directory already exists.
But what should the library say if you mount a drive on “/usr”, while a directory with that name already exists. Do you want the mount to fail?
Personally, I think that the physical directory should be ignored by the “ff_” functions.
And yes, a call to ff_mkdir
should fail.
Some work has to be done here.