×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    26

    Question folder creation fails on N95

    Hi,

    I'm trying to create a folder under c:\
    I'm using open c in my application.

    mkdir("c:\\newdir", 0777);

    It works fine on e:\, but fails on c:\.

    Could someone tell me if the access is restricted to c:\?

    How do I create a private folder under c:\?

    Thanks,
    jvin
    Last edited by jvinjam; 2009-02-05 at 04:49.

  2. #2
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,348

    Re: folder creation fails on N95

    To create a new directory, use RFs::MkDir().

    Code:
    _LIT(KNewDir,"C:\\NewDir\\");
    ...
    User::LeaveIfError(fsSession.MkDir(KNewDir));
    Last edited by A.A.M.; 2009-02-05 at 07:50.

  3. #3
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: folder creation fails on N95

    In Symbian OS the notion of "private directory" (folder is really a Windows term for the visual representation of a directory) has a particular meaning and such directories would be placed under !:\private while their name would be hardcoded to that of application's secure ID.

    Also, as A.A.M. suggests the APIs to be used are different in Symbian C++ compared to OpenC. As such, it is better for you to ask the question on the OpenC forum.

    Now, what OpenC and Symbian C++ have in common is that API calls will return errors or throw exceptions/leaves if they not succeed. The solution you are looking for depends on the error received and the particular meaning it has for the particular API so please make sure to provide this info when asking a question.
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,752

    Re: folder creation fails on N95

    I can easily imagine that your directory has been created on the first attempt already, and you get EEXIST for any subsequent calls.

    A.A.M.: for the same reason it might not be a good idea leaving on KErrAlreadyExists in the Symbian C++ case. BaflUtils::EnsurePathExistL is a better choice if you want a leave on other errors.

  5. #5
    Registered User
    Join Date
    Jul 2007
    Posts
    26

    Re: folder creation fails on N95

    You are right. It was created.
    Nokia PC suite File manager only shows the files under c:\.
    I don't see the folders.

    Is it the expected behavior or is there some settings?

    Thanks,
    jvin

  6. #6
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: folder creation fails on N95

    Yes, that's the expected behavior. If you have private data to store they should be stored in your private directory, if you have user data that must be stored in the file system then those should be under C:\Data or E:\
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

Similar Threads

  1. N95 Accelerometer & JSR-256
    By AnthonyAndrews in forum Mobile Java General
    Replies: 9
    Last Post: 2009-04-21, 22:12
  2. [j2me] Delete Folder
    By altropinto in forum Mobile Java General
    Replies: 1
    Last Post: 2008-03-30, 19:19
  3. Folder creation
    By rathodavinash in forum Symbian
    Replies: 2
    Last Post: 2005-08-20, 17:02
  4. creation of a folder to include lib files
    By symashi in forum Symbian
    Replies: 0
    Last Post: 2005-05-13, 07:54
  5. 6620 HttpConnection creation fails with "Symbian OS Error -18"
    By rmanheim in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2004-03-18, 17:57

Posting Permissions

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