Boost logo

Boost :

Subject: Re: [boost] [filesystem] home_directory_path
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2010-10-20 07:33:20

Bjørn Roald wrote:
> On 10/19/2010 06:56 PM, Christian Holmquist wrote:
> >
> > Is there a POSIX equivalent for My Documents?
> I think the users home directory is the closest you get as a general
> statement unless you start getting into details that are more
> specific for each POSIX system and/or distribution.

I disagree. The home directory is more like C:\ on Windows. As I mentioned in another post, there is no specific equivalent. Each user chooses to put documents in various subdirectories as suits their preference, so there isn't a good default on POSIX systems. Some desktop environments provide an equivalent, but as there is no standard even among those, it is still up to client code to determine the best equivalent, if wanted.

> method name POSIX path XP path
> --------------------------------------------------------------
> -----------------------------------
> temp_path /tmp
> c:\TEMP
> user_(home|profile)_path /home/bjorn
> c:\Documents and
> Settings\bjorn
> user_docs_path /home/bjorn
> c:\Documents and Settings\bjorn\My Documents

I disagree with your mappings. I think leaving undefined what has no standard definition is superior. Also, temp_path should be taken from the environment before using a fallback like /tmp.

> user_appdata_path /home/bjorn
> c:\Documents and Settings\bjorn\AppData
> appdata_path /etc
> c:\Documents and Settings\All
> Users\AppData
> user_desktop_path /home/bjorn/Desktop ??
> c:\Documents and Settings\bjorn\Desktop
> desktop_path /etc/Desktop ??
> c:\Documents and Settings\All Users\AppData
> etc..

This gets one into even more proprietary directions. A Desktop "folder" assumes a GUI which isn't necessarily the case on a POSIX system. The AppData "folder" on Windows has no equivalent on POSIX systems. /etc is not appropriate as the user won't have write permission unless root. If such were to be supported by Filesystem, the best behavior remains leave undefined what has no standard definition.

Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.

Boost list run by bdawes at, gregod at, cpdaniel at, john at