10-25-2009 10:03 PM
I'm trying to get my application working in the OS 5.0 (9000) simulator, but my file I/O code no longer works. So I've started over, writing the simplest code possible and working from there. If I do this:
String url = "file:///SDCard/testing.txt";
FileConnection fc = null;
try
{
fc = (FileConnection) Connector.open(url, Connector.READ);
} catch (IOException e) { }
It does not open testing.txt. fc.exists() and fc.canRead() both return false. I've set up a directory on the host computer to represent the SD card contents, added a file called testing.txt, and verified that fc.list() is able to enumerate the filenames in "file:///SDCard/" - including testing.txt. Why can it find the file name but not open the file? The RIM-supplied "Files" application is able to show me the filename but is unable to read the file (shows the text file icon next to the filename but shows a blank screen when I try to view it).
10-26-2009 09:36 AM
What are the stack trace and the detail message of the exception?
10-26-2009 09:41 AM
No exception is thrown; Connecter.open() just returns an unusable FileConnection instance.
10-26-2009 09:43 AM
Also forgot to mention that using the "store/" filesystem root does work, it's just "SDCard/" that exhibits this strange behavior.
10-26-2009 09:49 AM
Can you read files in the /home/user/ subdirectory on the SDCard?
10-26-2009 09:50 AM
No, I can't read any files, but I can traverse directories (e.g. FileConnection.list()).
10-26-2009 09:53 AM
Can it be a Windows (Vista?) permissions problem, since we are talking about the SDCard of the simulator?
10-26-2009 09:58 AM - last edited on 10-26-2009 09:59 AM
I had checked the permissions as well; they include read access for all users. Anyhow the simulator executable should be running as my username and I can open these files using Notepad etc...
Edit: I am running Vista, sadly enough.
Thanks for your help!
10-26-2009 01:14 PM
I have the same issue and I think it's a bug in the 5.0 simulator when it's set up to use a directory on the pc filesystem as the SDCard. All of the earlier simulators work fine.
11-08-2009 11:26 PM
I have the same problem under 5.0.
Everything is ok with 4.7