×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jun 2004
    Posts
    25

    How to locate private folder?

    Hi,

    I have an application that needs to create a file in runtime in the private folder. The application can be installed on both phone memory and memory card. First I tried to use RFs::PrivatePath to locate folder, but that did not seem to work when application was installed on memory card. So after that I tried to combine that path with PathInfo::PhoneMemoryRootPath and PathInfo::MemoryCardRootPath. But then I ended up with wrong path when installing on phone memory, seems like c:\data\private\<sid>\ was the path when using this. So how can i resolve this?

    Before 3rd Edition I used the same folder as the .app-file and Application::AppFullName and BaflUtils:riveAndPathFromFullName to find this folder.

    Edit: I see now that i can create the folder with RFs::CreatePrivatePath, but will this folder be removed when the application is uninstalled if it is uninstalled from memory card and the folder is on phone memory?
    Last edited by cartman_ume; 2006-11-27 at 15:35.

  2. #2
    Registered User
    Join Date
    Jun 2004
    Posts
    25

    Re: How to locate private folder?

    This seems to do the trick.
    Code:
    CCommandLineArguments * pArguments = 0;
    TChar drive = 'C';
    TRAPD(rc, pArguments = CCommandLineArguments::NewL());
    if (pArguments != 0)
    {
    	drive = pArguments->Arg(0)[0];
    	delete pArguments;
    }
    But why does RFs::PrivatePath leave out the drive letter? Is there a good reason for this?

  3. #3
    Registered User
    Join Date
    Feb 2006
    Location
    London
    Posts
    34

    Re: How to locate private folder?

    Quote Originally Posted by cartman_ume
    This seems to do the trick.
    Code:
    CCommandLineArguments * pArguments = 0;
    TChar drive = 'C';
    TRAPD(rc, pArguments = CCommandLineArguments::NewL());
    if (pArguments != 0)
    {
    	drive = pArguments->Arg(0)[0];
    	delete pArguments;
    }
    But why does RFs::PrivatePath leave out the drive letter? Is there a good reason for this?
    It leaves out the drive letter because the private directory structure can be on the C drive, memory card or any other drive.

    Also note that the private directories are not secured through any encryption. The OS just doesn't allow you to access these areas without the correct security policy.

    So using a private directory on a memory card will be secure on the phone, but when removed and placed in a computer it is not longer secure, as it can be accessed openly

  4. #4
    Registered User
    Join Date
    Jun 2004
    Posts
    25

    Re: How to locate private folder?

    Quote Originally Posted by sandopolus
    It leaves out the drive letter because the private directory structure can be on the C drive, memory card or any other drive.

    Also note that the private directories are not secured through any encryption. The OS just doesn't allow you to access these areas without the correct security policy.

    So using a private directory on a memory card will be secure on the phone, but when removed and placed in a computer it is not longer secure, as it can be accessed openly
    Ok, but there should maybe be an option to the function so that one can get the directory on the same drive as the app is installed. Or will the installer remove all private directories when uninstalling the application?

    About the security, yes I know this about the memory card and I think it is strange that it is so easy to read it from a computer. Actually I just put my N80 in "Data transfer" with the cable and can access all files on memory card, no need to remove the card.

  5. #5
    Registered User
    Join Date
    Feb 2006
    Location
    London
    Posts
    34

    Re: How to locate private folder?

    Quote Originally Posted by cartman_ume
    Ok, but there should maybe be an option to the function so that one can get the directory on the same drive as the app is installed. Or will the installer remove all private directories when uninstalling the application?

    About the security, yes I know this about the memory card and I think it is strange that it is so easy to read it from a computer. Actually I just put my N80 in "Data transfer" with the cable and can access all files on memory card, no need to remove the card.
    I have seen a way to work out which drive the app is installed on, but i can't remember where.
    As for the unistallation of the application. I think that all private directories for the app are removed, but it is just something that you will have to test to find out for sure.

  6. #6
    Registered User
    Join Date
    Jun 2004
    Posts
    25

    Re: How to locate private folder?

    Quote Originally Posted by sandopolus
    I have seen a way to work out which drive the app is installed on, but i can't remember where.
    As for the unistallation of the application. I think that all private directories for the app are removed, but it is just something that you will have to test to find out for sure.
    The code i posted above works to find out the drive.

Similar Threads

  1. TextEditor with two errors
    By ahashim in forum Personal Profile
    Replies: 0
    Last Post: 2006-08-29, 23:43
  2. Read/Write on PC!!!!
    By rubicita in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-10-21, 13:07
  3. Streams in/out on PC!!!
    By rubicita in forum Bluetooth Technology
    Replies: 0
    Last Post: 2005-10-18, 20:37
  4. another Null pointer exception
    By kvchen1985 in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2004-06-28, 15:33
  5. PC Connectity with VB6
    By mkintanar in forum PC Suite API and PC Connectivity SDK
    Replies: 5
    Last Post: 2003-09-24, 04:18

Posting Permissions

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