Skip to main content
Niks
Associate II
February 23, 2017
Question

Delete non-empty directory chan's FatFs

Posted on February 23, 2017 at 10:47

Hello,

I wanted to delete the directories created using f_mkdir(). I have created some files inside directories. I could delete the individual files inside directories but unable to delete the entire directory.

My application includes number of directories and each directory consist of 100 files.

Would appreciate your response...!!! 

Thanks in advance,

Nikhil 

    This topic has been closed for replies.

    2 replies

    ilias
    Associate III
    September 10, 2017
    Posted on September 10, 2017 at 21:00

    Hello,

    I have exactly the same request. 

    Did you finally managed to get a solution? I would appreciate if you could share your solution if any.

    Thanks

    Tesla DeLorean
    Guru
    September 10, 2017
    Posted on September 10, 2017 at 23:39

    You'd need to enumerate through the content deleting the files as you go and descending into the subdirectories. If recursion isn't appealing you could create a processing list where you come back to the directories after the files have been removed.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..