Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User jvinjam's Avatar
    Join Date
    Jul 2007
    Posts
    26
    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 Moderator A.A.M.'s Avatar
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,308
    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 ltomuta's Avatar
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,335
    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.

  4. #4
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    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 jvinjam's Avatar
    Join Date
    Jul 2007
    Posts
    26
    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 ltomuta's Avatar
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,335
    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:\

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 C++
    Replies: 2
    Last Post: 2005-08-20, 17:02
  4. creation of a folder to include lib files
    By symashi in forum Symbian C++
    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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved