BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-01-2008, 06:54 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2008
Location: Chennai
Model: 8130
PIN: N/A
Carrier: AIRTEL
Posts: 51
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default File system error

Please Login to Remove!

Hi all,

my code is,

FileConnection fc = (FileConnection)Connector.open("file:///filename.txt");

It throughs the Exception

net.rim.device.api.io.file.FileIOException: File system error

What to do now?

I want to read the content of the file...
__________________
Jayaseelan.V
Mobile Application Developer
INDIA.
Offline  
Old 07-01-2008, 07:16 AM   #2 (permalink)
Knows Where the Search Button Is
 
irlennard's Avatar
 
Join Date: Jan 2008
Location: Berlin
Model: 9000
Carrier: T-Mobile
Posts: 32
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

The file system has two "roots": store and SDCard. You need to specify one of these, depending on where your file is.

E.g.

Code:
FileConnection fc = (FileConnection)Connector.open("file:///SDCard/filename.txt");
-- Ian
Offline  
Old 07-01-2008, 07:22 AM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Oct 2007
Location: chennai.india
Model: 8100
PIN: N/A
Carrier: airtel
Posts: 57
Post Thanks: 0
Thanked 0 Times in 0 Posts
Arrow

AFAIK the problem is in your fileconnection path.where can u save your "filename.txt" wther phone are sd card memory ..
__________________
thanx n regards
jeyaprakash.c
Offline  
Old 07-01-2008, 07:23 AM   #4 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2008
Location: Chennai
Model: 8130
PIN: N/A
Carrier: AIRTEL
Posts: 51
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi irlennard,

Thanks for your reply..

Now am trying this in Simulator... Not in Real Device..

So in Simulator how can i use this...

Thanks in Advance..
__________________
Jayaseelan.V
Mobile Application Developer
INDIA.
Offline  
Old 07-01-2008, 07:23 AM   #5 (permalink)
Thumbs Must Hurt
 
Join Date: Oct 2007
Location: chennai.india
Model: 8100
PIN: N/A
Carrier: airtel
Posts: 57
Post Thanks: 0
Thanked 0 Times in 0 Posts
Arrow

it may helps you
sdcard- SDCard/BlackBerry/
phonememory-store/home/user/
__________________
thanx n regards
jeyaprakash.c

Last edited by jeyaprakash.c : 07-01-2008 at 07:27 AM.
Offline  
Old 07-01-2008, 07:29 AM   #6 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2008
Location: Chennai
Model: 8130
PIN: N/A
Carrier: AIRTEL
Posts: 51
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jeyaprakash.c View Post
it may helps you
sdcard- SDCard/BlackBerry/
phonememory-store/home/user/
Hi jeyaprakash,

Am testing it in 8800 Simulator 4.2.1 version of JDE..

How to set Path for testing in Simulator?
__________________
Jayaseelan.V
Mobile Application Developer
INDIA.
Offline  
Old 07-01-2008, 07:38 AM   #7 (permalink)
Thumbs Must Hurt
 
Join Date: Oct 2007
Location: chennai.india
Model: 8100
PIN: N/A
Carrier: airtel
Posts: 57
Post Thanks: 0
Thanked 0 Times in 0 Posts
Arrow

hi
In emulator we can use both phone and sdcard memories..

For Sdcard:
FileConnection fc = (FileConnection)Connector.open("file:///SDCard/BlackBerry/filename.txt");

For Device Memory:
FileConnection fc = (FileConnection)Connector.open("file:///store/home/user/filename.txt");
__________________
thanx n regards
jeyaprakash.c
Offline  
Old 07-01-2008, 08:18 AM   #8 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2008
Location: Chennai
Model: 8130
PIN: N/A
Carrier: AIRTEL
Posts: 51
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jeyaprakash.c View Post
hi
In emulator we can use both phone and sdcard memories..

For Sdcard:
FileConnection fc = (FileConnection)Connector.open("file:///SDCard/BlackBerry/filename.txt");

For Device Memory:
FileConnection fc = (FileConnection)Connector.open("file:///store/home/user/filename.txt");
Hi,
i tried both..

Bur both are throughs

net.rim.device.api.io.file.FileIOException: File not found

Exception..

I dont know y it happens?
__________________
Jayaseelan.V
Mobile Application Developer
INDIA.
Offline  
Old 12-04-2008, 06:08 AM   #9 (permalink)
New Member
 
Join Date: Aug 2008
Model: 8300
PIN: N/A
Carrier: 8300
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default net.rim.device.api.io.file.FileIOException: File system error

hi,

First check, whether the file exists in the Filesystem, you can check that through browser. just paste the file path in the browser(Alt+P) check the existance of the file, or you can see from explore also.
after that u need to check your application.
String filepath = "file:///store/home/user/filename.txt";
FileConnection conn = (FileConnection) Connector.open(filePath,Connector.READ_WRITE);

I think it will work fine , Hoep so :P

Thanks
Ravi
Offline  
Old 05-26-2009, 06:32 AM   #10 (permalink)
New Member
 
Join Date: May 2009
Model: 7290
PIN: N/A
Carrier: meet bug in blackberry JDE 4.7.0
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear All,

When i coding for reading csv & txt file, I have a problem similar with Jayaseelan. And i have done follow everyone who have reply in this topic.
At last i have not reading csv & txt file. I'm using the "Blackberry JDE 4.7.0" tool and run it on Windown xp sp2. please help me if you know !

here is my code:

String filePath = "file:///store/home/user/test.txt";
FileConnection fc = (FileConnection)Connector.open(filePath,Connector. READ_WRITE);
if(!fc.exists()) {
throw new IOException("File does not exist");
}
InputStream is = fc.openInputStream();

Thanks & Best regards,
Tiep Le
Offline  
Old 08-17-2009, 04:35 PM   #11 (permalink)
New Member
 
Join Date: Aug 2009
Model: 8100
PIN: N/A
Carrier: AT&T
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default BB 8100 Simulator File Not Found error

Dear All,
I am simulating(using JDE 4.2.0) a MIDlet application to open/write a text file on my local XP SP2 file system as:
"OutputConnection connection = (OutputConnection)
Connector.open("file:///myfile.txt;append=true", Connector.WRITE );"
After I invoke the application on the BB Simulator, it displays:
"net.rim.device.api.io.file. FileIOException: File system erro"

I appreciate your help, Reza
Offline  
Old 09-10-2009, 02:20 PM   #12 (permalink)
New Member
 
Join Date: Aug 2009
Model: 8300
PIN: N/A
Carrier: none
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

For levantiep and rgholami (and others who come along later),

In levantiep's case it is most likely that you are trying to 'read' a file which doesn't really exist. Since you are testing in the simulator I'd try first to read a file off of the SDCard since you can easily verify if the file exists in the simulator directory or not (sorry, I haven't figured out where the simulator keeps files which are on the device memory - possibly someone else can tell us this info). When the simulator starts up you need to tell it where to put the SDCard files by selecting 'Simulte' -> 'Change SD Card'. By default it is set to 'None' - you need to choose a directory and the default directory is usually the directory where you installed the simulator. In that directory the simulator will create a directory call Blackberry with all of the subdirectories needed (such as
audiobooks, documents, music, pictures etc.). Once you do this a message will pop up in the simulater saying the SD Card is inserted (note that you must do this step every time you restart the simulator). Now place your file you want to read in the folder you want to read from and refer to it as follows:

ex: file is 'simulator directory'/Blackberry/documents/test.txt

then code is
Code:
String filePath = "file:///SDCard/documents/test.txt";
FileConnection fc = (FileConnection)Connector.open(filePath,Connector. READ_WRITE);
if(!fc.exists()) {
throw new IOException("File does not exist");
}
InputStream is = fc.openInputStream();
If you still can't open the file then you have some issue I don't know about (possibly permission issues???)

As for rgholami's case:
Again, it appears that your file does not exist in the simulator environment - I have never written/read a file from the main root "file:///" and don't know if you can do this. So, I'd suggest following the suggestion I gave levantiep above first (try accessing files on the SD Card first), then try moving the file to the device memory (I don't know how you would do this manually but you could write the file out to the device memory programmatically first and then write/read it). As well, in your case if the file you are trying to write to doesn't exist you will get an exception - so you could try to create it with fc.create(); first if it didn't exist using if(!fc.exists()).

Also noticed that you are using static method open for Connector whereas you should probably use the pattern in levantiep's example above and get a FileConnection fc.

Last edited by Kory Lovre : 09-10-2009 at 02:30 PM.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.