Skip to content

SD examples don't close file handles [imported] #832

@cmaglie

Description

@cmaglie

This is Issue 832 moved from a Google Code project.
Added by 2012-02-27T14:19:44.000Z by kevin.os...@gmail.com.
Please review that bug for more context and additional comments, but update this bug.

Original labels: Type-Defect, Priority-Medium

Original description

I've only checked the list example, but if there are more than 26 files on a card, it fails. (only lists the first 26 files on the card, including directories). I recreated it by:
touch 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 etc... 36
Here's the output:
Initializing SD card...initialization done.
1 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0
10 0
11 0
12 0
13 0
14 0
15 0
16 0
17 0
18 0
19 0
20 0
21 0
22 0
23 0
24 0
25 0
done!
after applying the fix (attached)
Initializing SD card...initialization done.
1 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0
10 0
11 0
12 0
13 0
14 0
15 0
16 0
17 0
18 0
19 0
20 0
21 0
22 0
23 0
24 0
25 0
26 0
27 0
28 0
29 0
30 0
31 0
32 0
33 0
34 0
35 0
36 0
done!

The reason is that the program runs out of file handles. It keeps openNextFile()-ing, but never closes them.
attached is a fixed example.

What version of the Arduino software are you using?
Arduino1.0
On what operating
system?
Windows 7
Which Arduino board are you using?
Uno R2

Please provide any additional information below.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions