220 28270 <nrh28q$mir$1@blaine.gmane.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Matthew Woehlke <mwoehlke.floss@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Filesystem Library and Standardized Paths
Date: Fri, 16 Sep 2016 11:14:36 -0400
Lines: 54
Approved: news@gmane.org
Message-ID: <nrh28q$mir$1@blaine.gmane.org>
References: <316e66e9-764b-40da-bffc-e0ce2ed75ddd@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Trace: blaine.gmane.org 1474125148 4828 195.159.176.226 (17 Sep 2016 15:12:28 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 17 Sep 2016 15:12:28 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.1.0
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC37LBFWUIFBBSN26W7AKGQESPIWGEY@isocpp.org Sat Sep 17 17:12:24 2016
Return-path: <std-proposals+bncBC37LBFWUIFBBSN26W7AKGQESPIWGEY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vk0-f69.google.com ([209.85.213.69])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC37LBFWUIFBBSN26W7AKGQESPIWGEY@isocpp.org>)
	id 1blHHp-0007YR-K8
	for gclcip-std-proposals@m.gmane.org; Sat, 17 Sep 2016 17:12:13 +0200
Original-Received: by mail-vk0-f69.google.com with SMTP id i184sf86618359vkd.2
        for <gclcip-std-proposals@m.gmane.org>; Sat, 17 Sep 2016 08:12:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=to:from:subject:date:lines:message-id:references:mime-version
         :content-transfer-encoding:user-agent:in-reply-to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=eyxaISAztZdBecrZzWUq8WBvuUZ8r97a7WNd0j2IakU=;
        b=wZiEpo2DUJYDC6Hz6XddcYkATJMIdQSpvQyWbt3sm7hf5CIDBZDEJC/W9x7RnoS2UF
         nCiAIGdiCxpcah39vhmYWphERAuugsL5aS7LO2sO+1WNc1HUyQheZfx3vMEcLD2mrBK1
         w0ByUQP7Ay8DQGLQ24LAGcAIOdbKgVwKB0F3ZAn3p3XiYk+QaFMdlSdupAuQWF+Bk9+E
         0jEHX5kZyEYCspmq7qcr4ccjlnXSspb71xABd6p3JWjIO1yWo3OUGxIVfzt/KoDG6I++
         4V8jKl68LPkUlZIk9+8oTZNlWhUvN+xB6qSDg5HfcQ0eFuHdXJbKpUryI15l6FTeNjdW
         oREw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:to:from:subject:date:lines:message-id:references
         :mime-version:content-transfer-encoding:user-agent:in-reply-to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=eyxaISAztZdBecrZzWUq8WBvuUZ8r97a7WNd0j2IakU=;
        b=fRXae/zjfgZyxcbAb4KeNdVP17NclDNe7L9ans1UnaIhJ6TpqoUMTV0zP0gE1KgZIL
         WGKVfXxg2QRKTrsoc5ookzP228zr1nvueCfWjET35dlHJAOaS8xPe35gyloBJjzJULIg
         k1g79pJvm044rqYW/xqONmkCdc2o+9F7o84kbzcyGcWiMFyzjUdAfA1KVKosxTmUz9B0
         qR2lPmO/GMdv66kCOOR/DRs9KMSQUHFPntw7alq6ARz19iCNed1pFT4PV3IPPSd4Avrz
         qSmXW0bNIl5cks109z3OamvYYpM/PToLZINRLBtkcwj9j+sPUGLLUtXK2EmHC68KPwWe
         eyeg==
X-Gm-Message-State: AE9vXwNS/mJGwjCjb81yHvNHd6rqGdZKS2y9eXBoQDr+fxT7S5rvP44Mes2dDb6cJVkqVg==
X-Received: by 10.200.52.202 with SMTP id x10mr1554766qtb.67.1474125129860;
        Sat, 17 Sep 2016 08:12:09 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.5.211 with SMTP id 77ls7699746otd.49.gmail; Sat, 17 Sep
 2016 08:12:08 -0700 (PDT)
X-Received: by 10.129.178.129 with SMTP id q123mr1454024ywh.103.1474125128963;
        Sat, 17 Sep 2016 08:12:08 -0700 (PDT)
Original-Received: by 10.55.164.133 with SMTP id n127msqke;
        Fri, 16 Sep 2016 08:14:53 -0700 (PDT)
X-Received: by 10.46.32.227 with SMTP id g96mr6227979lji.30.1474038893487;
        Fri, 16 Sep 2016 08:14:53 -0700 (PDT)
Original-Received: from blaine.gmane.org ([195.159.176.226])
        by mx.google.com with ESMTPS id 82si2168185lfp.18.2016.09.16.08.14.53
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 16 Sep 2016 08:14:53 -0700 (PDT)
Received-SPF: neutral (google.com: 195.159.176.226 is neither permitted nor denied by best guess record for domain of gclcip-std-proposals@m.gmane.org) client-ip=195.159.176.226;
Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2)
	(envelope-from <gclcip-std-proposals@m.gmane.org>)
	id 1bkuqm-0001fC-H4
	for std-proposals@isocpp.org; Fri, 16 Sep 2016 17:14:48 +0200
X-Injected-Via-Gmane: http://gmane.org/
Original-Lines: 35
Original-X-Complaints-To: usenet@blaine.gmane.org
X-Enigmail-Draft-Status: N1110
In-Reply-To: <316e66e9-764b-40da-bffc-e0ce2ed75ddd@isocpp.org>
X-Original-Sender: mwoehlke.floss@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=neutral
 (google.com: 195.159.176.226 is neither permitted nor denied by best guess
 record for domain of gclcip-std-proposals@m.gmane.org) smtp.mailfrom=gclcip-std-proposals@m.gmane.org;
       dmarc=fail (p=NONE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:28270
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/28270>

On 2016-09-11 11:19, Jens =C3=85kerblom wrote:
> Hello there,
>=20
> I've been looking through the proposed C++17 Filesystem library and thoug=
ht=20
> it would be a nice add-on to have common paths. The only path I see that =
is=20
> already present is the *std::filesystem::temp_directory_path*. The=20
> directories of interest (as I see) would be
>=20
>    - *executable_directory_path*, *installed_directory_path* or maybe a=
=20
>    better name, *bundle_directory_path*, directory where the executable i=
s=20
>    being run / has been installed. Assumed to be read-only.

I don't think you can implement this without platform support. That
support *might* already be available on common platforms, but then again
it might not.

Implementing it for example on Linux requires digging around in /proc.
Specifically, you need something like https://github.com/gpakosz/whereami.

>    - *userdata_directory_path*, directory where current user stores data,=
=20
>    "My Documents" on Windows for example. Assume permission required to w=
rite=20
>    and read.
>    - *cache_directory_path*, directory to data that persists longer than =
in=20
>    *temp_diretory_path*, can be removed by OS if deemed necessary.=20
>    "Library/Cache" on iOS for example. Assume write and read permission.
>    - *appdata_directory_path*, directory where the application can store=
=20
>    persistent data not to be shared with other application.=20
>    "/data/data/<package_name>" on Android for example. Assume write and r=
ead=20
>    permissions.

These may be simplifications. I would compare with existing prior art,
e.g. http://doc.qt.io/qt-5/qstandardpaths.html.

--=20
Matthew

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/nrh28q%24mir%241%40blaine.gmane.org.

.
