Boost logo

Boost :

Subject: Re: [boost] [filesystem] home_directory_path
From: Chad Nelson (chad.thecomfychair_at_[hidden])
Date: 2010-10-20 10:08:21


On Wed, 20 Oct 2010 07:40:34 -0400
"Stewart, Robert" <Robert.Stewart_at_[hidden]> wrote:

> "Stewart, Robert" <Robert.Stewart_at_[hidden]> wrote:
>
>> You said yourself, above, that My Documents on Windows is
>> intended to be the repository of user-generated content. (As
>> opposed to the "USERPROFILE" directory, which is presumably for
>> program-generated files such as configuration files.) On *NIX
>> systems, the user's home directory, or more often a
>> user-selected subdirectory of it, serves the same purpose. So
>> as Bjørn Roald said in another reply, why not just return the
>> user's home directory for the document path?
>
> Anything close to an equivalent on POSIX systems is likely to be a
> user-selected subdirectory of the user's home directory, so choosing
> the home directory is wrong. Indeed, the home directory should have
> little but subdirectories and "dot files," just as a Windows system's
> C:\ should have little more than subdirectories, choosing the home
> directory as the default location to dump documents is wrongheaded.

Automatically saving user-generated content into it is wrong. Returning
it from that function might not be, if there's no better logical
candidate. Since the requested directory *is* explicitly for
user-generated content, presumably most programs would use the returned
path to pop up a load/save dialog to the user (who would then manually
navigate to his preferred subdirectory for his documents), or would
append their own subdirectory names to it before silently saving files.

That's how popular Linux programs like Firefox, Thunderbird, and Claws
Mail work, the first time they need a place to load or save files to.
And how the OS-provided programs on Ubuntu work too. (After that, most
of them use the last directory that you saved or loaded anything
to/from, and wouldn't need that function.)

So long as the behavior is documented, I don't think it would be a
problem. As a developer it's what I'd want, because if I had to write
OS-specific changes to my program to make it work, it would be a lot
less useful to me.

-- 
Chad Nelson
Oak Circle Software, Inc.
*
*
*



Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk