BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-22-2011, 01:15 PM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: May 2008
Model: 8700
PIN: N/A
Carrier: Telcel
Posts: 69
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default FileIOException file not found

Please Login to Remove!

I'm working on this app which has to export the data the user is working to a txt file, for future reference use.

But i'm getting a "file not found" exception thrown, funny thing is, i check if the file exist in which case, i just open the existing file or create a new one

Code:
 String filename = "name";
            FileConnection fc = (FileConnection) Connector.open("file:///SDCard/docs/");
            if(!fc.exists())
                fc.mkdir();
            if(fc.isDirectory())
            {
                fc.close();
                fc = (FileConnection) Connector.open("file:///SDCard/docs/data/");
                if(!fc.exists())
                    fc.mkdir();                
                if(fc.isDirectory())
                {
                    FileConnection file = (FileConnection) Connector.open("file:///SDCard/docs/data/" + filename + ".lec", Connector.READ_WRITE);
                    if(!file.exists())
                        archivo.create();
                    OutputStream data = file.openOutputStream();
                    String info = getInfo();
                    if(info != "0")
                    {
                        data.write(info.getBytes());
                        data.close();
                        file.close();
                    }
                    else
                    {
                        data.close();
                        file.close();
                    }
                }
So, any idea it aint working???

The directories are created either manually or on runtime as you can seem and the sd it is writeable
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

Similar Threads for: FileIOException file not found
Thread Thread Starter Forum Replies Last Post
I/O Error: Import file not found: ..\KSoapLibrary\deliverables\Standard\5.0.0\KSoapL i Ruchijain Developer Forum 0 07-12-2010 02:02 AM
Bes 4.1.7 Mr2 Mikey_AGBoston BES Admin Corner 5 04-29-2010 03:37 PM
how to force jad file to be re-generated on each build plevintampabay Developer Forum 2 07-30-2009 10:22 AM
File Transfers Not Working Via Bluetooth - Help! nudais General 8300 Series Discussion - Curve 11 10-26-2007 10:58 AM





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