×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Regular Contributor
    Join Date
    May 2010
    Posts
    413

    private path access.

    hello i am using private path for storing my response in txt file and also some values which i use for my application in .ini file. i used as follows for txt file.

    QString responsefile(QApplication::applicationDirPath());
    responsefile.append("/response.txt");

    the file is created in the private path i checked it by showing message box if file exists. and also the value is written to the file.

    but the value in the file is not getting fetched when i needed. all the values is empty.

    i opened the file as follow.

    QString pathforresponse = QApplication::applicationDirPath() + "/response.txt";
    QFile file(pathforresponse);
    QByteArray readbytes;

    if(file.exists())
    {
    if( file.open((QIODevice::ReadOnly | QIODevice::Text)))
    {
    QMessageBox msgBox;
    msgBox.setText("fileopened");
    msgBox.exec();
    readbytes = file.readAll();
    file.close();
    }
    }

    and got the file and opened it but the value is not read. any problem in which i am using this file in private path?????. same thing happenes for my .ini file also which is in the private path. wats the problem thanks for any replies.

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: private path access.

    Private path is not a problem for application itself. Are you sure that your file "response.txt" contain data?

  3. #3
    Regular Contributor
    Join Date
    May 2010
    Posts
    413

    Re: private path access.

    Quote Originally Posted by savaj View Post
    Private path is not a problem for application itself. Are you sure that your file "response.txt" contain data?
    hello savaj thanks for the reply... i found the problem when i tried to write the things into the file its not written to the file, the data to be written is empty.... here is my code for writing into file

    QString responsefile(QApplication::applicationDirPath());
    responsefile.append("/response.txt");
    QFile file(responsefile);



    if (file.open(QIODevice::WriteOnly))
    {
    file.write(bytes);
    QMessageBox msgBox;
    msgBox.setText(bytes);
    msgBox.exec();
    file.close();
    }

    here bytes is empty savaj. but in emulator this works fine.. bytes is declared as a global variable as

    QByteArray bytes;

    in detail the response which i get from httpcommunicator in downloadReadyRead(); i append the response in this function, and finally i write the response(bytes) in finishedSlot(); function. after that i clear the bytes variable.

    wats the problem here which works in emulator not in device?????
    Last edited by kathir.s; 2011-11-09 at 06:45.

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

    Re: private path access.

    "bytes" may be empty, but how is that connected to the file access? "bytes" comes from somewhere and it is being written to the file (i.e. you are adding an empty buffer to the file). file.write does not modify the content of "bytes", but it does return an error code, which you should inspect in order to see whether writing works or not ...
    -- 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

  5. #5
    Regular Contributor
    Join Date
    May 2010
    Posts
    413

    Re: private path access.

    Quote Originally Posted by ltomuta View Post
    "bytes" may be empty, but how is that connected to the file access? "bytes" comes from somewhere and it is being written to the file (i.e. you are adding an empty buffer to the file). file.write does not modify the content of "bytes", but it does return an error code, which you should inspect in order to see whether writing works or not ...
    hello itomuto thanks for your reply i dnt mean that bytes are related to the file access. i meant that the bytes is the variable which i have stored the response and then i am writing the bytes into file.

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

    Re: private path access.

    Yes, but how is that related to your question? The fact that "bytes" is empty does not give any info about the "private path access" problem, a problem which in fact does not exist (as said by @savaj, the private path is fully accessible to the application that owns it).
    -- 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

  7. #7
    Regular Contributor
    Join Date
    May 2010
    Posts
    413

    Re: private path access.

    Quote Originally Posted by ltomuta View Post
    Yes, but how is that related to your question? The fact that "bytes" is empty does not give any info about the "private path access" problem, a problem which in fact does not exist (as said by @savaj, the private path is fully accessible to the application that owns it).
    thanks for the reeply. is there any specifications to be added for internet access in the application. i am using nokia c7 and i have connected the internet in wifi mode. and i can access the net in browser, so the internet is working in mobile. but from my application i am sending an request and receiving a response but the response is empty wat could be the problem here???? is any problem in accessing the internet from my application??? my application response is little bit big in size so in phone it wont return the response which is bigger in size ???? in stimulator i checked the response size is approximately 9kb ill it cause any problem when this response return in mobile??? because by response is empty... in mobile the downloadReadyRead() function where i get the response is not at all called...y this so??? very confused !!!!!!!!!!!!

    thanks for any replies.

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

    Re: private path access.

    Ok, so if you have a networking problem I suggest that you start a new thread, with a proper subject and a relevant code snippet so that we know what API you use and what/where it fails.

    The minimal requirement for an application to be able to access the network in Symbian is that the NetworkServices capability is declared, which I trust you have done.
    -- 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

  9. #9
    Regular Contributor
    Join Date
    May 2010
    Posts
    413

    Re: private path access.

    Quote Originally Posted by ltomuta View Post
    Ok, so if you have a networking problem I suggest that you start a new thread, with a proper subject and a relevant code snippet so that we know what API you use and what/where it fails.

    The minimal requirement for an application to be able to access the network in Symbian is that the NetworkServices capability is declared, which I trust you have done.
    ya k sure itomuta thanks for the answers... let me try it out to solve the problem if cant. ill start the other thread.. and for the information i have used the networkservices capability. thanks itomuta.

Similar Threads

  1. Creating Folder in Private Path
    By gailu in forum Symbian
    Replies: 9
    Last Post: 2008-08-19, 21:35
  2. DLL private path
    By ManuMies in forum Symbian
    Replies: 8
    Last Post: 2008-04-11, 11:38
  3. Play audio from private path
    By sruthimp in forum Symbian
    Replies: 9
    Last Post: 2007-08-27, 11:38
  4. how to get Midlet Private path?
    By Rozik in forum Mobile Java General
    Replies: 0
    Last Post: 2007-06-01, 09:34
  5. private path in emulator
    By tektronic in forum Symbian
    Replies: 3
    Last Post: 2007-02-07, 06:11

Posting Permissions

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