Hi Mark,

Thanks for reply, is there any methods to read non-local file (file
present outside my application specific area).

Arvind 

-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark Murphy
Sent: Wednesday, December 10, 2008 7:52 PM
To: [email protected]
Subject: [android-developers] Re: Getting error when trying to read file
: java.lang.IllegalArgumentException: File /data/testing.txt contains a
path separator


Chandrakar Aravind-rqj386 wrote:
> I am trying to read non-local txt file, but I am getting error:
> 
>       java.lang.IllegalArgumentException: File /data/testing.txt 
> contains a path separator

You probably don't have a file at /data/testing.txt.

> My code is like that:
> 
>       FileInputStream _orifile_ =
> openFileInput("/data//_samplefile_._txt_");

openFileInput() accepts relative paths only. No leading slashes are
allowed. openFileInput() represents files stored in an
application-specific storage area. getFilesDir() will tell you where
this is, IIRC.

--
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.9 Available!



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to