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

  • Home
  • SEARCH
  • 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 9063217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:56:12+00:00 2026-06-16T15:56:12+00:00

Resolution: As Thomas pointed out below, the task I have been given is near

  • 0

Resolution: As Thomas pointed out below, the task I have been given is near to impossible to achieve, and the data must be on the fly determined since the template structure used by ANY OS can be overridden fairly easily, and there is NEVER a way to guarantee that a pre-built template can be correctly applied. My thanks to all who replied (even if I was to dense to get it in the first place…) 😛

I have no access to a mac or windows based machine at this time and I am working on a cross-platform project(Win/Lin/Mac).

On linux the return from a call to

os.path.expanduser('~')

returns /home/<user>

Now in any operating system the $home directory structure contains a final point which is common to all paths, (On my linux install the home paths are /home/<user> by default, making /home the last common point).

So My question (which I cant simply test at the moment) is this:
On windows and mac, barring some unusual reconfiguration (software product is for average joe blow home users and teenagers) is the final part of the returned path always the first non-common path part?

(This question could be made more clear but I am stumbling for how to explain this. This is rewrite three.)

EDIT: After reading an article linked by phihag in the comments below, I think he is asking for better clarification of my intended use (The impossible specification thing).
What I am trying to do is determine the part of the return from os.path.expanduser('~') which I can convert to be the first part of new relative path definition from which I could then create further directory structures which are application specific for each user. The equivalent of /home/<user>/.config/<MyAppHere> or \Documents and Settings\<user>\Application Data\Roaming\<MyAppHere>. My final result will use (if this question can be determined True for my intentions) the following:

# Assumes linux system and home path of /home/<user
head, tail = os.path.split(os.path.expanduser('~'))
userConfigPath = os.path.join(tail,'.config',MYAPPNAME)

# userConfigPath then gets written to a config file which is used by the program
# to determine where (within a greater structure) to look for a user based
# configuration which expands or overrides system configuration options.

EDIT: After exchanging info with Thomas Orozco (below):
At this stage of the software execution, it doesn’t know where to look for custom user configurations. What is going to be read from the config file is not an absolute address, but a template of how to build an absolute address for a config file.

The software in question is related to video games and has an intended user base of teenagers or adults working on a standard home computer. Most of these users do not utilize special configuration options like customized home user directory locations. This portion of the code works with the so called norms for any OS, and disregards the possibilities of customizations to the OS in question. While is bad practice programmaticly, it is what I am currently stuck with.

  • 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-16T15:56:14+00:00Added an answer on June 16, 2026 at 3:56 pm

    This is not even true on Linux. Just have a look at /etc/adduser.conf:

    • GROUPHOMES=yes would let adduser create homes such as: /home/groupname/user.
    • LETTERHOMES=yes would create ones looking like: /home/u/user.

    And that’s just the default. You can put you home anywhere you like.


    Regarding what you’re trying to achieve, why isn’t the following appropriate?

    from os.path import join, expanduser
    join(expanduser('~'), '.config') # You could have something more funky if you want to. 
    

    Then, just compute this path on the fly when the application is run, without hardcoding it into your app.

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

Sidebar

Related Questions

We have a high-resolution PDF (for printing) which has some form fields on it.
I have a high-resolution image that I want to use as a tiled map
EDIT following resolution, this has been substantially edited to dump irrelevant detail and explain
I have searched the web for resolution of this error, but everything I have
I have some high resolution images and have to re-size it to be smaller
I'm trying to get a high resolution icon or thumbnail in Windows given a
I have the following table: ticket arrivaltime resolution time status t1 '2012-09-03' null new
My page has a resolution of 800x480. It has been designed as such. Now
virtual function resolution happens with pointer/reference and not with object. Now consider below example:
When screen resolution is >1000px I have A, B, and C as 280, 350,

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.