eHat
Posts: 2
Joined: Tue Apr 19, 2016 11:45 pm

Java ME FileConnection problem

Wed Apr 20, 2016 1:05 am

I am trying to read a file on my Raspberry Pi using the following code without success.

Code: Select all

FileConnection fconn = (FileConnection) Connector.open("file:///" + path, Connector.READ);
After printing out the roots using this code

Code: Select all

Enumeration em = FileSystemRegistry.listRoots();
            while(em.hasMoreElements()){
                System.out.println(em.nextElement());
            }

I get the following roots:

_dev_root/
devtmpfs/
sysfs/
proc/
tmpfs/
devpts/
tmpfs/
tmpfs/
tmpfs/
cgroup/
cgroup/
cgroup/
cgroup/
cgroup/
cgroup/
cgroup/
systemd-1/
mqueue/
debugfs/
configfs/
fusectl/
_dev_mmcblk0p1/
tmpfs/
gvfsd-fuse/
_dev_sda/

And my real root is not among them.
Is there a solution to this problem, adding a root maybe?[/url]

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: Java ME FileConnection problem

Wed Apr 20, 2016 2:37 am

eHat wrote: I get the following roots:

_dev_root/
...

Your real root is hiding right there in front of you.

Use the df command from a terminal... your real root / will show as:

/dev/root /


marcus
marcus
:ugeek:

eHat
Posts: 2
Joined: Tue Apr 19, 2016 11:45 pm

Re: Java ME FileConnection problem

Wed Apr 20, 2016 11:15 am

So simple, it works like a charm.

Tank you :)

Br, Edvin

Return to “Java”