|
Boost : |
Subject: Re: [boost] [filesystem] home_directory_path
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2010-10-20 14:45:55
Chad Nelson wrote:
>
> Automatically saving user-generated content into it is
> wrong. Returning it from that function might not be, if there's
> no better logical candidate.
That distinction is interesting, but is it necessary that the function have a default on POSIX systems? We've suggested ideas on how that could be set by the client, according to some local policy without Filesystem having to impose an opinion on what is most appropriate.
> 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.
Saving in or under My Documents is not so unlike saving in or under one's home directory. Perhaps I'm too stridently against content being put into the home directory thus not wanting to encourage that by making it the default.
> 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.
Your notion of an app saving the user's last directory is reasonable, meaning that the My Documents directory, or its equivalent, would be used only when there is no user-driven default available. Since the home directory is at least the parent of the directory in which the user would want to put a file, its use in that scenario is not unreasonable.
If Filesystem offered a means to override the path returned by home_directory_path() (or however it's spelled), then those that prefer something else can set it and those that prefer the home directory can leave the default.
BTW, it would be better to refer to the result as the "documents directory" instead of the home directory since there isn't a good notion of home directory on Windows. Thus, documents_directory_path() or get_os_path(path_documents) (or something along those lines).
_____
Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP http://www.sig.com
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 acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk