언어 설정

Menu
Sites
Language
IOError: Stream is closed

Hi Guys,

I am developing an app for Gear2 Watch in which need to read some IndexDB database information from the database and write the information to a text file. I was trying to loop through a indexDB cursor and trying to write to the file But I am getting "IOError: Stream is closed."   error on line 53.

Here is the link of my code: http://ideone.com/gr9XF0 

I searched but did not get any help.

I am wondering what is the possible reason for this error. Is there any solution? help me plz

Thanks,

답변 바로가기

Responses

2 댓글
colin Rao

FYI.

I am not familiar with the index DB, when I use the RDBMS, we'll try to avoid use the cursor, instead of read all the data to a local data set/table, and then iterate the local data set/table.

Is there a similiar way in index DB?

Mark as answer
Sniper

Hi,

I actually solved the problem by closing the file when the cursor becom empty. You can save the data in Array or other suitable data structure.

Thanks