×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Mar 2006
    Location
    Ahmedabad
    Posts
    38

    problem while Creating folder on series 40 nokia phones like nokia 5300

    Hi all !
    I have series 40 3rd edition nokia 5300 handset and it is also have JSR75 for file connectionapi !

    I am also able to create regular file using j2me but I can'tcreate folder on file system. .
    Its always gives me error like :
    Java.io.IOException mkdir called for a file
    like this

    Note : I am able to create dir as well as file on nokia e50, sony ericsson z550i

    void createFile(String newName, boolean isDirectory)
    {
    try
    {
    String path="file:///" +currDirName +newName;
    System.out.println("PATH : "+path);
    FileConnection fc = (FileConnection) Connector.open(path);
    if (isDirectory)
    {
    fc.mkdir();
    }
    else
    {
    fc.create();
    }
    showCurrDir();
    }
    catch (Exception e)
    {
    String s = "Can not create file '" + newName + "'";
    if (e.getMessage() != null && e.getMessage().length() > 0)
    {
    s += "\n" + e;
    }
    Alert alert = new Alert("Error!", s, null, AlertType.ERROR);
    alert.setTimeout(Alert.FOREVER);
    Display.getDisplay(this).setCurrent(alert);
    // Restore the commands that were removed in commandAction()
    Display.getDisplay(this).getCurrent().addCommand(creatOK);
    Display.getDisplay(this).getCurrent().addCommand(back);
    }
    }

    Reply me soon

    Thanks..
    Premal

  2. #2
    Regular Contributor
    Join Date
    Aug 2006
    Location
    Rawalpindi, Pakistan
    Posts
    486

    Re: problem while Creating folder on series 40 nokia phones like nokia 5300

    have u tried creating the folder into another directory. try creating a folder in pictures or something.
    Regards
    Nouman

  3. #3
    Registered User
    Join Date
    Mar 2006
    Location
    Ahmedabad
    Posts
    38

    Re: problem while Creating folder on series 40 nokia phones like nokia 5300

    Yes !
    I Tried and it cause same IOException like mkdir() called for file message

    Have you tried on same device?
    can u provide me sample code which u r getting success to create dir on series 40 3rd phones..

    thanks..
    premal

  4. #4
    Regular Contributor
    Join Date
    Aug 2006
    Location
    Rawalpindi, Pakistan
    Posts
    486

    Re: problem while Creating folder on series 40 nokia phones like nokia 5300

    try this code.

    String url = "f1= (FileConnection)Connector.open("file:///c:/kool_Jul_29_13.00.59.txt",Connector.READ);
    FileConnection fconn = (FileConnection) Connector.open( url, Connector.READ_WRITE );

    if (!fconn.exists())
    fconn.create();


    if(fconn.canWrite())
    {
    fconn.setWritable(true);
    OutputStream os = fconn.openOutputStream();
    String msg="hello world!";
    os.write(msg.getBytes());
    os.close();
    }
    Regards
    Nouman

  5. #5
    Registered User
    Join Date
    Mar 2006
    Location
    Ahmedabad
    Posts
    38

    Re: problem while Creating folder on series 40 nokia phones like nokia 5300

    Hi !
    Thanks for quich reply!
    But I can't understand your code and anyway its seems to pointing file
    on file systems.

    I was asking creating directory on file system. I am capable to write file on file system.

    it means mkdir() cause exception..

    and also I can't under stand url as expresssion fo file connection in ur code..?
    what is this?
    Thanks..
    Premal

  6. #6
    Registered User
    Join Date
    Mar 2004
    Posts
    1

    Re: problem while Creating folder on series 40 nokia phones like nokia 5300

    just append "/" to the end of the directory path

Similar Threads

  1. Nokia, do you listen to your customers? Problems of your new phones
    By djprofessork in forum General Development Questions
    Replies: 3
    Last Post: 2007-09-24, 15:15
  2. What is the real problem to receive data calls with Nokia TDMA cel modems?
    By jackal_jr in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2002-12-09, 09:02
  3. What is the real problem to receive data calls with Nokia TDMA cell modem?
    By jackal_jr in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2002-12-04, 16:05

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×