Hello everyone,
I just wrote my first test program using the file connection api.
I have tested it on the emulator and it works fine.
then i loaded it onto my E60 and reading files works just fine but when i try to create a folder the application just closes
this is my function to create my folder
filecon.mkdir();Code:public void createFolder() { try { FileConnection filecon = (FileConnection) Connector.open("file:///C:/Data/test/"); // Always check whether the file or directory exists. // Create the file if it doesn't exist. if (!filecon.exists()) { System.out.println("makedir"); filecon.mkdir(); } filecon.close(); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } }
is causing the application to close
is it that i cantcreate files/folders on the device at all?
or can i only create files/folders in certain paths?
this funktion asks for permission evertime but works fine:
Code:private void getRoots() { Enumeration drives = FileSystemRegistry.listRoots(); System.out.println("The valid roots found are: "); while (drives.hasMoreElements()) { root = (String) drives.nextElement(); System.out.println("\t" + root); } }

Reply With Quote


