Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8394591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:05:59+00:00 2026-06-09T20:05:59+00:00

I have Qt application which should work on multiple platforms. One of those platforms

  • 0

I have Qt application which should work on multiple platforms. One of those platforms is Linux. I am completely new in Linux world.

My application need to create and manage set of data files. After reading some links about linux directory structure I decided to store data files in /var/myapp directory and in its subdirectories.

Here is the problem: if my application runs without superuser privileges then it has no rights to create /var/myapp directory. Even if i will create directory manually (with sudo) my application will not have rights to write files there.

Is it possible to temporary elevate application’s permissions from Qt code to create /var/myapp directory and write files there?

Or possibly there is another place in Linux directory structure which is by default available for storing application’s data files?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T20:06:01+00:00Added an answer on June 9, 2026 at 8:06 pm

    You could distribute it without installation scripts, but you’d have to tell them to run it once as root… or have the app run itself as root using gksudo/kdesudo if its system wide data files do not exist.
    The custom though is to make a package (.deb, .rpm, or even a .tar.gz that the user will extract himself) including all necessary files.

    But linux (and OS X for that matter) are multi user systems. Are you sure your files belong in /var or /usr? If they’re created at runtime as you say, don’t they depend on user input? In which case you need to put them in some directory inside the user’s home directory (getenv(“HOME”)).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple applications which work with one centralized Oracle database. The applications are
I have an application which logs in into a webservice. I start a new
I'm prospecting alternatives to develop for multiple mobile platforms, and have found Codename One
How to work with multiple windows in Cocoa? I have created a cocoa application.
see i m writing one avi demuxer library. In which i have exported multiple
I have one ASP.NET web application running at the web server root which provides
I have a table in an application for which the current schema is: CREATE
I have application which uses Sherlock ActionBar package. The application uses platform-specific behavior for
I have application which needs to use a dll (also written by me) which
I have an application which uses the microsoft kinect device. The thing is that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.