Maximum number of files on SD card.

I am trying to write one small file per day to an SD card using the 0022 SD library.

I find that I can only write just under 120 files before it fails to write a further file.
The last file appears to be created but no data is written

Around this limit is reached regardless of whether the files are all in the root directory or are distributed in monthly directories.

Using a PC it is possible to write at least 365 similar files to the card.

I recall that DOS had a limit of 112 files in the root dir but it had no limits in any subdir,

So start with a folder called 2012 and retry your sketch…

I have already tried this by changing the structure to 12 monthly directories each with upto 31 files. However when the total number of files reaches just below 120 mark it stops writing again.

A quick look does not show any restriction of this kind in the SD library (missed it?)

Could it be that you are running out of RAM or so? memory leak?

Can you make a minimalist (stripped) version of your code that still shows this effect? (loop creating X-files or so)

If a minimalist version does work with >120 files it is somewhere in the other code (interaction with) ==> post code

I think is a faulty card - I have found that another card works perfectly and I can write 12 x 31 files. This will be a better format than 365 files in one directory so I haven't checked whether this is possible.

Thanks for your suggestions .

ericw: I think is a faulty card - I have found that another card works perfectly and I can write 12 x 31 files. This will be a better format than 365 files in one directory so I haven't checked whether this is possible.

Thanks for your suggestions .

Bear in mind that there is a huge problem with factory failed flash memory being resold to manufacturers that have no problems repackaging and selling it as sound memory; sometimes with the original size listed on the label, even though they know it will not work under any load.