×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,956

    Writing/Replacing files

    My project's files are placed inside the /opt/projectname/bin/somefolder.Now how can i replace a file which is kept at the same path.

    I am successfully reading the xml file from the above path, but now the requirement is such that i have to replace that file at run time with a new file of same name.

    I tried with QFile methods, but unable to write a file at this location.Does it requires any credentials to be added in manifest file or else?

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2009
    Posts
    1,024

    Re: Writing/Replacing files

    Hi,
    Your app should not write any file in /opt. You should read/write files only in the HOME (/home/user) directory.
    The first time your app is launched it can copy the file from /opt to QDir::home() + "/.local/share/data/yourAppName".
    Then you can write and read it.
    Writing files which are installed by debian files is risky. The package manger can complain and fail uninstallation process.

  3. #3
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,956

    Re: Writing/Replacing files

    thanks ...

Similar Threads

  1. writing gpx files from a gps MIDlet
    By geomcp18 in forum Mobile Java General
    Replies: 0
    Last Post: 2010-12-01, 20:37
  2. problem writing files
    By glamalil in forum Mobile Java General
    Replies: 13
    Last Post: 2007-06-04, 09:40
  3. Writing images into files
    By prashant332 in forum Mobile Java General
    Replies: 1
    Last Post: 2006-01-12, 19:13
  4. Reading and Writing Files
    By Stengun in forum Mobile Java General
    Replies: 5
    Last Post: 2004-03-15, 15:20
  5. Reading Writing Files
    By marcgom in forum Mobile Java General
    Replies: 1
    Last Post: 2003-02-25, 08: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
  •