BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-22-2011, 12: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 01:02 AM
Bes 4.1.7 Mr2 Mikey_AGBoston BES Admin Corner 5 04-29-2010 02:37 PM
how to force jad file to be re-generated on each build plevintampabay Developer Forum 2 07-30-2009 09:22 AM
File Transfers Not Working Via Bluetooth - Help! nudais General 8300 Series Discussion - Curve 11 10-26-2007 09:58 AM

SAMSUNG M393B2G70BH0-CK0 16GB 2Rx4 DDR3 PC3L-12800R 1600MHz REG DIMM Ram
$42.0
SAMSUNG M393B2G70BH0-CK0 16GB 2Rx4 DDR3 PC3L-12800R 1600MHz REG DIMM Ram pictureSamsung Prostar 816 Key DISPLAY Phone Black 816D
$75.0
Samsung Prostar 816 Key DISPLAY Phone Black 816D pictureNew Samsung SmartDome SCC-C6407N 32x Zoom WDR Day/Night Surveillence CAMERA
$699.95
New Samsung SmartDome SCC-C6407N 32x Zoom WDR Day/Night Surveillence CAMERA pictureAll New T400xw01 V5 40T01-C00 Logic Board For Samsung La40a350c1 C
$62.62
All New T400xw01 V5 40T01-C00 Logic Board For Samsung La40a350c1 C pictureNew Slit Lamp Eyepiece Digital Adapter for Samsung Galaxy S5. Include 3 sleeves
$187.0
New Slit Lamp Eyepiece Digital Adapter for Samsung Galaxy S5. Include 3 sleeves picture






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