Marlin icon indicating copy to clipboard operation
Marlin copied to clipboard

Set or reset DIR_ATT_HIDDEN attribute for directory entry

Open vyacheslav-shubin opened this issue 3 years ago • 6 comments

Provide SdFile hide/unhide directory entry

vyacheslav-shubin avatar Jul 23 '21 13:07 vyacheslav-shubin

Ok, but … why? This is not something that Marlin will be using, as far as existing plans go. And, when an SD card is mounted in target mode, the host operating system handles file operations.

thinkyhead avatar Jul 23 '21 21:07 thinkyhead

The Marlin FAT driver does not support deleting files with long names. This operation results with orphans in the directory entry. Instead of the delete operation, you can apply the operation of hiding the file, which gives the same result for listing them.

vyacheslav-shubin avatar Jul 26 '21 08:07 vyacheslav-shubin

Wouldn't it be better to port over the long filename deletion code from the newest greiman/SDFat?

thinkyhead avatar Jul 31 '21 05:07 thinkyhead

Yes, it is better, but this is a slightly different functionality, which could also be

vyacheslav-shubin avatar Aug 02 '21 08:08 vyacheslav-shubin

It seems like adding the capability to the code doesn't hurt anything, since nothing calls it and it won't ever be linked in.

I think using hide in place of delete is a terrible idea. That will just inexplicably fill up people's SD cards with hidden files, which sounds pretty incorrect to me. Maybe we are already doing that with orphaned entries, but I don't really agree with replacing one bug with another...

sjasonsmith avatar Dec 16 '21 06:12 sjasonsmith

I'm sorry that last comment probably came across harsher than intended. While I don't personally like the proposed solution, there is a lot of value in bringing up ideas and discussing alternative solutions. I don't want to discourage you from trying to come up with ways to solve problems you encounter, even if this one doesn't move forward. I often end up talking myself out of my own ideas as well!

sjasonsmith avatar Dec 16 '21 06:12 sjasonsmith