开发者

BlackBerry File system

I have written an application for BlackBerry devices that stores some files in the internal storage. I use this line to get a connection to the storage

Connect开发者_如何学编程or.open("file:///store/BlackBerry/myDir/", Connector.READ_WRITE);

The first time my applications tries to access this storage I check to see if the proper directories exist and if not I create them with .mkdir();

This process works perfectly for me on two devices (a Bold and a Torch) I am now trying to run this application on a Curve and it is failing to create the directories for me. It gives me this error:

"net.rin.device.api.io.file.File.IOException: File system error(12)"

Do any devices use something besides "store/" in the path to their internal storage? Or is there anything else that could be different about the Curve devices internal storage that would cause this exception from that line on this device but not on the others?


You should use FileSystemRegistry.listRoots() to find out what root file systems are avaialable. The Bold 9000 and Torch 9800 both have interal flash storage but IIRC the Curve does not. See also this link from RIM.


It turns out that the root(file:///store/) is read only on this device. To get it working I just moved into a deeper directory. I am now using:

"file:///store/home/user/BlackBerry/myDir/"


Are you sure that is the code triggering this error? 12 would seem to indicate the SQLite is not working properly. Check out this link, where some guy got this from opening and closing (database) files to quickly. He also indicated that Curve does not support "SQLite in devicememory".

Another not-SQL-related Google find: RIMs support pages. There the problem was that BOTH output stream and file connection needed to be closed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜